简体   繁体   English

运行 npx 以启动 Strapi 应用程序时,我收到与我的节点版本相关的相同错误

[英]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.

相关问题 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&gt;node --version v15.4.0**** - 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**** npx create-react-app 在运行 npm 启动时出错 - npx create-react-app gives error when running npm start 在全新安装 node.js 时运行 npx create-react-app myapp 时出错 - Error when running npx create-react-app myapp on fresh install of node.js 当我在创建 `npx create-react-app my-app` 之后执行 `npm install` 时,当我启动应用程序 `npm start` 时它给我错误 - when i do `npm install` after create `npx create-react-app my-app` than its gives me error when i launch application `npm start` 运行 npx create-next-app 时如何克服 spawn unknown 错误。 在 vscode 中 - How do I get over the spawn unknown error while running npx create-next-app . in vscode 运行 npx create-react-app my-app 时出错 - Error when I run npx create-react-app my-app 我正在使用“npx create-react-app”创建一个新的 reactjs 应用程序,当它完成并尝试使用“npm start”运行它时,我收到一个错误 - I'am creating a new reactjs application using “ npx create-react-app” , and when it's done and trying to run it using “npm start” , I get an error 在创建反应项目时在“npx create-react-app my-app”之后运行命令“npm start”时出错 - getting error when run command 'npm start' after 'npx create-react-app my-app' in creating a react project 每次我运行 npx create-react-app my-app 它都会在 npm start 后显示这个 html webpack 错误 - Every time i run npx create-react-app my-app it shows this html webpack error after npm start 尝试安装 strapi 节点 v18 时出现错误 - I get an error when trying to install strapi node v18
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM