首页 > 解决方案 > 如何在安装 create-react-app 时修复“错误:spawn cmd ENOENT”?

问题描述

我正在安装一个 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>

标签: reactjscreate-react-app

解决方案


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

它对我有用


推荐阅读