【问题标题】:create-react-app using npx generating error message path not foundcreate-react-app 使用 npx 生成错误消息路径未找到
【发布时间】:2018-02-16 09:32:37
【问题描述】:

运行以下命令后出现错误

npx create-react-app

"$basedir/../../Users/abc/AppData/Local/Yarn/.global/node_modules/.bin/create-react-app.cmd" "$@" 系统找不到指定的路径。

节点和 NPM 版本

λ node -v
v9.5.0

λ npm -v
5.6.0

【问题讨论】:

  • 我也尝试过使用 npm -g intall create-react-app,当我要创建应用程序时,控制台上显示同样的错误

标签: create-react-app


【解决方案1】:

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

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

简而言之,create-react-app.cmd 文件位于 ProgramFils\nodjs 文件夹中,我不知道该文件为何/如何存在。删除 creat-react-app 命令文件后,一切都设置好了。

【讨论】:

    【解决方案2】:

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

    yarn create react-app [name of app]
    

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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-11-05
      • 2021-04-24
      • 2021-03-03
      • 1970-01-01
      相关资源
      最近更新 更多