首页 > 解决方案 > 当我尝试做 create-react-app 给出不同的错误

问题描述

当我尝试使用启动应用程序时

npx create-react-app projectname

它给出了错误:

error @babel/core@7.9.0: The engine "node" is incompatible with this module. Expected version ">=6.9.0". Got "15.0.0-nightly20200618a4f3206b76"
error Found incompatible module.

完整的味精:

warning You are using Node "15.0.0-nightly20200618a4f3206b76" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
(node:159119) [DEP0139] DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability.
(Use `node --trace-deprecation ...` to show where the warning was created)
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

yarn add v1.22.4
warning You are using Node "15.0.0-nightly20200618a4f3206b76" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
(node:159152) [DEP0139] DeprecationWarning: Calling process.umask() with no arguments is prone to race conditions and is a potential security vulnerability.
(Use `node --trace-deprecation ...` to show where the warning was created)
[1/4] Resolving packages...
[2/4] Fetching packages...
error @babel/core@7.9.0: The engine "node" is incompatible with this module. Expected version ">=6.9.0". Got "15.0.0-nightly20200618a4f3206b76"
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 /home/rudeprabesh/work/hellow has failed.

create-react-app 版本是:v3.4.1

节点版本为:v12.18.2

npm 版本为:v6.14.5

npx 版本为:v6.14.5

标签: reactjsreact-nativereact-redux

解决方案


从 ubuntu 软件管理器中卸载节点 js。

然后使用以下命令安装节点 js:

sudo apt-get update
sudo apt-get install nodejs

来自:这里

这一步我成功了


推荐阅读