【问题标题】:'create-react-app' is not recognized as an internal or external command or operable program or batch file'create-react-app' 未被识别为内部或外部命令或可运行程序或批处理文件
【发布时间】:2017-12-25 15:46:44
【问题描述】:

我尝试创建 React 项目,但 create-react-app my-app 命令不起作用..请帮助

这里是命令

npm install -g create-react-app

create-react-app 我的应用

here is screenshort of my commands

【问题讨论】:

  • 请在此处将您的命令添加为代码块,而不是链接。
  • 你试过谷歌搜索吗?在 Windows 上似乎是一个非常常见的错误,并且很容易解决。
  • 是的,我在谷歌上搜索,但我未能解决问题,然后我在这里提交问题..
  • 请检查C:\User\<your user id>\AppData\Roaming\npm是否在你的%PATH%中。
  • 是的,我给了路径变量..

标签: javascript node.js reactjs react-native npm


【解决方案1】:

为什么截图是 2017 年 12 月 25 日的。你需要重新安装最新版本的 node 并尝试最新版本的 React。

npm install -g npm-windows-upgrade
npm-windows-upgrade

那就做吧

npm install -g create-react-app
create-react-app my-app

【讨论】:

    【解决方案2】:

    首先检查您的节点版本。如果您的节点版本为 8 或更高版本,则使用 8
    'npx create-react-app my-app' 在上面的版本中,我们只需要更改一个单词 npx 你不需要做其他事情。希望对你有帮助

    【讨论】:

    • 它对我有用,谢谢! @Sourabh Dubey
    【解决方案3】:

    check this 并运行:

    npm install create-react-app
    
    npx create-react-app my
    

    【讨论】:

      【解决方案4】:

      可能是您的 npm 不在您的环境变量路径中。请尝试

      npx create-react-app my-app
      

      【讨论】:

        【解决方案5】:

        也许你可以试试react-native init 而不是create-react-app。 赞react-native init my-app

        【讨论】:

          【解决方案6】:

          你可以试试

          npx create-react-app bla-bla
          

          【讨论】:

            猜你喜欢
            • 2015-12-30
            • 2018-07-08
            • 1970-01-01
            • 2014-10-14
            • 2021-03-09
            • 2016-07-29
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多