[英]When running npx to start Strapi app I get the same error related to my Node version
I'm just trying to get started and I always run into the same errors.我只是想开始,我总是遇到同样的错误。 I have run the following npx command to start my first strapi app as I am supposed to:
我已经运行了以下 npx 命令来启动我的第一个 Strapi 应用程序,因为我应该这样做:
npx create-strapi-app strapi-blog --quickstart
and each time i got the error that said the following:每次我收到以下错误消息时:
Error while installing dependencies: error strapi-blog@0.1.0: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.xx". 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
I actually uninstalled and reinstalled node versions 12, 13, and 14.5.3 to see if it will fix it - I did this using nvm (node version manager) but to no avail... still received the same error stating that:我实际上卸载并重新安装了节点版本 12、13 和 14.5.3 以查看它是否会修复它 - 我使用 nvm(节点版本管理器)执行此操作但无济于事......仍然收到相同的错误说明:
'The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.xx". Got "15.3.0" Keep trying!
Then I did some research and found what one other user had said was helping them which is run yarn create strapi-app strapi-blog --quickstart.然后我做了一些研究,发现另一位用户所说的帮助他们的是运行 yarn create strapi-app strapi-blog --quickstart。 I did that literally the same process through each node individually running them and then uninstalling them etc. and never got it to work.
我通过每个节点单独运行它们然后卸载它们等,实际上做了相同的过程,但从未让它工作。 This is the error I get on my browser .
这是我在浏览器上遇到的错误。 This is my terminal when I run yarn create strapi-app strapi-blog --quickstart or npx create-strapi-app strapi-blog --quickstart it doesn't matter I still get the following from my terminal which I have included in two screenshots since I wanted to show the full result.
这是我运行 yarn create strapi-app strapi-blog --quickstart 或 npx create-strapi-app strapi-blog --quickstart 时的终端截图,因为我想显示完整的结果。 Here and here
这里和这里
and just to clarify, this is also always what i get when i run yarn start...澄清一下,当我运行 yarn start 时,这也总是我得到的......
Node.js is the underlying framework used to run Strapi. Node.js 是用于运行 Strapi 的底层框架。
The engine "node" is incompatible with this module.
引擎“节点”与此模块不兼容。 Expected version ">=10.16.0 <=14.xx".
预期版本 ">=10.16.0 <=14.xx"。 Got "15.3.0"
得到“15.3.0”
This indicates you're using a version of Node that is outside of the range supported by Strapi.这表明您使用的 Node 版本超出了 Strapi 支持的范围。 You'll need to use an older version of Node.
您需要使用旧版本的 Node.js。
Managing node versions used to be really annoying but now there's Node Version Manager (nvm)!管理节点版本曾经非常烦人,但现在有了节点版本管理器 (nvm)!
Install nvm:安装 nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Install node '14.17.5':安装节点“14.17.5”:
nvm install 14.17.5
Switch to the older node version:切换到旧节点版本:
nvm use 14.17.5
This will switch all the node.js running on the computer to use this version, if you notice any issues, use the 'use' command to change it back.这会将计算机上运行的所有 node.js 切换为使用此版本,如果您发现任何问题,请使用“使用”命令将其改回。
The error mentions that the node engine npx is using is v15.3.0
, which is declared as incompatible by strapi-blog@0.1.0
.该错误提到 npx 正在使用的节点引擎是
v15.3.0
,它被strapi-blog@0.1.0
声明为不兼容。
You should be able to confirm which node version npx is using with the following command: npx --call "node -v"
您应该能够使用以下命令确认 npx 正在使用哪个节点版本:
npx --call "node -v"
I think all you need to do is go to nodejs.org, download and install v14.15.3 and make sure that is what npx
is using.我认为您需要做的就是将 go 下载到 nodejs.org,下载并安装
npx
并确保 npx 正在使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.