我正在尝试create-react-app
在ubuntu 18.04
终端中使用 npx 的命令创建一个react应用程序。我已经Node v12.8.0
安装了。当我npx create-react-app .
在我的应用程序目录中运行命令时,我希望生成 react 应用程序样板文件夹和文件,因为我的机器上有最新版本的Node
v12.8.0
和npm
v6.10.2
。相反,我得到以下输出...
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/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/<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
用于 nodejs的版本。卡在这里了...