【问题标题】:When running npx to start Strapi app I get the same error related to my Node version运行 npx 以启动 Strapi 应用程序时,我收到与我的节点版本相关的相同错误
【发布时间】:2020-12-28 19:02:28
【问题描述】:

我只是想开始,但我总是遇到同样的错误。我已经运行了以下 npx 命令来启动我的第一个 Strapi 应用程序:

npx create-strapi-app strapi-blog --quickstart

每次我收到以下错误消息时:

 Error while installing dependencies:
error strapi-blog@0.1.0: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "15.3.0"
error Found incompatible module.
 
 Keep trying!
 
Oh, it seems that you encountered errors while installing dependencies in your project.
Don't give up, your project was created correctly.
Fix the issues mentionned in the installation errors and try to run the following command:
 
cd /Users/seanmodd/Courses/Udemy/Strapi/strapi-blog && yarn install

我实际上卸载并重新安装了节点版本 12、13 和 14.5.3 以查看它是否会修复它 - 我使用 nvm(节点版本管理器)执行此操作但无济于事......仍然收到相同的错误说明:

'The engine "node" is incompatible with this module. Expected version "&gt;=10.16.0 &lt;=14.x.x". Got "15.3.0" Keep trying!

然后我做了一些研究,发现另一位用户所说的帮助他们运行 yarn create strapi-app strapi-blog --quickstart。我通过每个节点单独运行它们然后卸载它们等,实际上做了相同的过程,但从未让它工作。 这是我在browser 上遇到的错误。这是我运行 yarn create strapi-app strapi-blog --quickstart 或 npx create-strapi-app strapi-blog --quickstart 时的终端截图,因为我想显示完整的结果。 Herehere

澄清一下,this is also always what i get when i run yarn start...

【问题讨论】:

    标签: reactjs content-management-system strapi npx headless-cms


    【解决方案1】:

    Node.js 是用于运行 Strapi 的底层框架。

    引擎“节点”与此模块不兼容。预期版本 ">=10.16.0

    这表明您使用的 Node 版本超出了 Strapi 支持的范围。您需要使用旧版本的 Node。

    管理节点版本曾经很烦人,但现在有了节点版本管理器 (nvm)!

    安装 nvm:
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

    安装节点“14.17.5”:
    nvm install 14.17.5

    切换到旧节点版本:
    nvm use 14.17.5

    这会将计算机上运行的所有node.js切换为使用此版本,如果您发现任何问题,请使用'use'命令将其更改回来。

    【讨论】:

      【解决方案2】:

      错误提示npx使用的节点引擎是v15.3.0,被strapi-blog@0.1.0声明为不兼容。

      您应该能够使用以下命令确认 npx 正在使用哪个节点版本:npx --call "node -v"

      我认为您需要做的就是访问 nodejs.org,下载并安装 v14.15.3 并确保 npx 正在使用它。

      【讨论】:

        猜你喜欢
        • 2018-11-25
        • 1970-01-01
        • 2019-07-07
        • 2017-12-21
        • 1970-01-01
        • 1970-01-01
        • 2016-11-27
        • 1970-01-01
        • 2020-10-06
        相关资源
        最近更新 更多