create-react-app 使用 npx 生成错误消息路径未找到

create-react-app using npx generating error message path not found

在 运行 执行命令后出现错误

npx create-react-app

"$basedir/../../Users/abc/AppData/Local/Yarn/.global/node_modules/.bin/create-react-app.cmd" "$@" The system cannot find the path specified.

节点和 NPM 版本

λ node -v
v9.5.0

λ npm -v
5.6.0

经过搜索和挖掘,我终于找到了解决方案。我之前安装了纱线,所以它混淆了一些东西......

create-react-app command was still working when i completely removed it form my PC.

简而言之 create-react-app.cmd 文件位于 ProgramFils\nodjs 文件夹中 我不知道 why/how 这个文件在那里。删除 creat-react-app 命令文件后,所有设置都已设置。

我有同样的错误信息。我通过使用 yarn 而不是 npx 解决了这个问题:

yarn create react-app [name of app]

注意 create 和 react-app 之间没有连字符