【问题标题】:How to resolve react create app 'sh' is not a valid command?如何解决 react create app 'sh' 不是有效命令?
【发布时间】:2020-09-27 15:41:35
【问题描述】:
npx create-react-app my-app

Creating a new React app in G:\project\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

'sh' is not recognized as an internal or external command,
operable program or batch file.

Aborting installation.
  yarnpkg add --exact react react-dom react-scripts cra-template --cwd G:\project\my-app has failed.

Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting my-app/ from G:\project
Done.

我已经尝试使用npm clear cache --force 清除 npm 缓存。同样的事情也会发生。

【问题讨论】:

标签: reactjs npm


【解决方案1】:

问题出在我的 Windows 命令提示符上。当我使用 Git bash 时,它运行良好。

【讨论】:

    猜你喜欢
    • 2018-05-02
    • 2018-01-09
    • 2019-04-26
    • 2021-12-28
    • 1970-01-01
    • 1970-01-01
    • 2021-06-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多