[英]When I write npx create-react-app-my-app " in CMD windows I m getting an error. I've installed Node.js : C:\Users\dev>node --version v15.4.0****
[英]When running npx to start Strapi app I get the same error related to my Node version
我只是想开始,我总是遇到同样的错误。 我已经运行了以下 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.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
我实际上卸载并重新安装了节点版本 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!
然后我做了一些研究,发现另一位用户所说的帮助他们的是运行 yarn create strapi-app strapi-blog --quickstart。 我通过每个节点单独运行它们然后卸载它们等,实际上做了相同的过程,但从未让它工作。 这是我在浏览器上遇到的错误。 这是我运行 yarn create strapi-app strapi-blog --quickstart 或 npx create-strapi-app strapi-blog --quickstart 时的终端截图,因为我想显示完整的结果。 这里和这里
Node.js 是用于运行 Strapi 的底层框架。
引擎“节点”与此模块不兼容。 预期版本 ">=10.16.0 <=14.xx"。 得到“15.3.0”
这表明您使用的 Node 版本超出了 Strapi 支持的范围。 您需要使用旧版本的 Node.js。
管理节点版本曾经非常烦人,但现在有了节点版本管理器 (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 切换为使用此版本,如果您发现任何问题,请使用“使用”命令将其改回。
该错误提到 npx 正在使用的节点引擎是v15.3.0
,它被strapi-blog@0.1.0
声明为不兼容。
您应该能够使用以下命令确认 npx 正在使用哪个节点版本: npx --call "node -v"
我认为您需要做的就是将 go 下载到 nodejs.org,下载并安装npx
并确保 npx 正在使用它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.