reactjs - 如何在安装 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>
解决方案
尝试将您的 react-scripts 依赖项降级到^2.1.8
您的 package.json 文件中。
它对我有用
推荐阅读
- javascript - 尝试使用 javascript 捕获页面方法
- regex - 使用 PowerShell,在文本文件中搜索多个匹配项和分组结果
- html - 在 html select 中设置一个不可选择的选项
- tinymce - 禁用对 tinymce 模式更改的自动对焦
- android - programm NFC Card inside the phone Android and Ios
- java - 克服 Java 中的类型擦除
- sonarqube - Sonarqube 6.7.4:如何将默认登录页面从 /about 更改为 /projects
- python - pip3:错误的解释器:没有这样的文件或目录
- html - 将 HTML 作为图像渲染到 Node.js 中的 Buffer 中
- c# - Get RowIndex from nested listview button click - UWP