【发布时间】:2021-02-08 07:57:14
【问题描述】:
我正在尝试创建一个新的 react 项目,但是当我运行 npx create-react-app tik-tok-clone 时出现以下错误
Creating a new React app in C:\Users\mwars\Documents\GitHub\TikTok-Clone\tik-tok-clone.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
error postcss@8.1.3: The engine "node" is incompatible with this module. Expected version "^10 || ^12 || >=14". Got "13.12.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts cra-template --cwd C:\Users\mwars\Documents\GitHub\TikTok-Clone\tik-tok-clone has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting tik-tok-clone/ from C:\Users\mwars\Documents\GitHub\TikTok-Clone
Done.
我已经尝试了一段时间,但无法让它发挥作用。
【问题讨论】:
-
在 Stack Overflow 上,不显示文字图片。将文本复制到问题中并设置格式,以便于阅读、复制和搜索。
-
问题是你的nodeJS版本。它要求版本 ^10、^12 和 >=14。可以运行 node --version 吗?
-
@WillianGaspar 我得到 v13.12.0
-
@WillianGaspar 如何更改我的 nodejs 版本
-
试试这个:phoenixnap.com/kb/update-node-js-version。但在此之前,试试这个帖子,看看它有帮助:stackoverflow.com/questions/56617209/…
标签: reactjs npm create-react-app npx