问题描述
我正在尝试在 ubuntu 18.04
终端中使用npx的 create-react-app
命令创建一个React应用.我已经安装了 Node v12.8.0
.当我在应用目录中运行命令 npx create-react-app.
时,由于我具有最新版本的 Node
v12.8.0
和 npm
v6.10.2
在我的机器中,相反,我得到了以下输出...
I'm trying to create a react app using npx's create-react-app
command in ubuntu 18.04
terminal.I have Node v12.8.0
installed. When I run the command npx create-react-app .
in the directory of my app, I expect the react app boilerplate folders and files to be generated since I have the latest version of Node
v12.8.0
and npm
v6.10.2
in my machine.Instead, I get the below output...
npx: installed 91 in 5.725s
Creating a new React app in /home/<my-PC>/Documents/todo-app.
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/[email protected]: 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/<my-PC>/Documents/todo-app has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting todo-app/ from /home/<my-PC>/Documents
Done.
因此,它最终在创建后立即删除了生成的应用程序文件夹.我认为它受到上面指定的 Node"13.0.0-nightly20190802452b393c1f"
的影响.我试图找到它,但是在我的机器上找不到它.在终端上,当我运行 node -v
时,得到的版本是 v12.8.0 .卡在这里...
So it ends up deleting the generated app folder as soon as it's created. I think it is being affected by the Node "13.0.0-nightly20190802452b393c1f"
specified above.I have tried to locate it but I can't find it on my machine.On the terminal, when I run node -v
I get the version v12.8.0
which is for nodejs. Am stuck here...
推荐答案
-
从ubuntu软件管理器中卸载Node js.
Uninstall the node js from ubuntu software manager.
然后使用以下命令安装节点js:
Then install node js with the following command:
sudo apt-get update
sudo apt-get install nodejs
这篇关于如何摆脱“节点" 13.0.0-nightly20190802452b393c1f",以便能够使用“创建-反应-应用"工具创建反应应用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!