没有安装夜间版本,出现了Node“13.0.0-nightly20190802452b393c1f”错误。

4
尝试创建React应用程序时,我遇到以下错误。
Creating a new React app in /home/sabin/development/react/complete-guide.

warning You are using Node "13.0.0-nightly20190802452b393c1f" 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"
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

yarn add v1.17.3
warning You are using Node "13.0.0-nightly20190802452b393c1f" 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"
[1/4] Resolving packages...
[2/4] Fetching packages...
error @babel/core@7.5.5: The engine "node" is incompatible with this module. Expected version ">=6.9.0". Got "13.0.0-nightly20190802452b393c1f"
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 --cwd /home/sabin/development/react/complete-guide has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting complete-guide/ from /home/sabin/development/react
Done.

操作系统: Ubuntu 18.04 node 版本: 12.8.1

我从未安装过夜版。我已经通过 nvm 卸载了 node,并且还从 Ubuntu 软件仓库卸载了 node 包。然后,我从 node 网站安装了版本为 12.8.1 的二进制文件。但即使我尝试使用 npx -p node@12 create-react-app appname 命令,仍然出现错误。如有帮助,请告知。

使用最新的 Linux 二进制文件重新安装 node


我发现在命令后附加 --use-npm 参数,如:npx create-react-app appname --use-npm可以解决我的问题。 - Sabin Howard
Horward,你是如何解决这个问题的?我也遇到了同样的问题... - Sugumar Venkatesan
1个回答

15
这个问题的解决方案很简单,Node已经从Ubuntu软件库安装,只需前往该库,然后进入已安装的软件并删除Node,然后通过官方网站重新安装即可。 https://istack.dev59.com/POn0V.webp

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接