reactjs - 当我尝试做 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
解决方案
从 ubuntu 软件管理器中卸载节点 js。
然后使用以下命令安装节点 js:
sudo apt-get update
sudo apt-get install nodejs
来自:这里
这一步我成功了
推荐阅读
- python - 我必须开发一个模型,该模型采用一系列随机值并给出预测值(整数)
- javascript - Firebase:如何从服务器上的用户名和密码生成访问令牌?
- plsql - 创建一个数据库触发器来检查一个日期是否添加了多个记录?
- r - 如何更新在R中估计相同值的不同类型的分布?
- javascript - 表格打印的引导按钮
- conemu - ConEmu 文字太淡
- docker - Freenas > Docker > Openproject 容器自动启动
- docker - 如何将多个 docker 镜像部署到单个虚拟机
- python - 将字符串转换为切片索引并为其赋值
- bluetooth - Apple Magic Keyboard/Trackpad 2 将与 linux 设备配对但不会连接