【问题标题】:How to fix "Error: spawn cmd ENOENT" while installing create-react-app?如何在安装 create-react-app 时修复“错误:spawn cmd ENOENT”?
【发布时间】:2019-05-07 12:33:53
【问题描述】:

我正在安装一个 create-react-app。 几周前我已经设法做到了,但这一次它不起作用。当我执行命令“npm start”时,它会引发错误。

我按照 reactjs.org 上的教程进行操作。

我已经卸载并重新安装了最新版本的 nodejs (v10.15.3)。我的 npm 版本是:6.9.0。

有什么线索可以帮助解决这个问题吗?谢谢

Starting the development server...

events.js:174
      throw er; // Unhandled 'error' event
      ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
Emitted 'error' event at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
    at onErrorNT (internal/child_process.js:415:16)
    at process._tickCallback (internal/process/next_tick.js:63:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! memory@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the memory@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Amelie\AppData\Roaming\npm-cache\_logs\2019-05-07T12_02_27_185Z-debug.log

C:\Users\Amelie\Documents\Formation Développeur WEB\React OCR\memory>.\node_modules.bin\eslint
Le chemin d’accès spécifié est introuvable.

C:\Users\Amelie\Documents\Formation Développeur WEB\React OCR\memory>

【问题讨论】:

标签: reactjs create-react-app


【解决方案1】:

尝试在 package.json 文件中将您的 react-scripts 依赖项降级为 ^2.1.8

它对我有用

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-15
    • 1970-01-01
    • 2019-10-27
    • 2020-11-13
    • 2019-11-25
    • 2015-10-02
    相关资源
    最近更新 更多