简体   繁体   English

如何在安装 create-react-app 时修复“错误:生成 cmd ENOENT”?

[英]How to fix "Error: spawn cmd ENOENT" while installing create-react-app?

I am installing a create-react-app.我正在安装一个 create-react-app。 I have already managed to do it few weeks ago, but this time it doesn't work.几周前我已经设法做到了,但这次它不起作用。 It throws an error when I do the command 'npm start'.当我执行命令“npm start”时它会引发错误。

I followed the tutorial on reactjs.org.我遵循了 reactjs.org 上的教程。

I have uninstalled and reinstalled latest version of nodejs (v10.15.3).我已经卸载并重新安装了最新版本的 nodejs (v10.15.3)。 My version of npm is : 6.9.0.我的 npm 版本是:6.9.0。

Any clue to help to solve this issue?有什么线索可以帮助解决这个问题吗? Thanks谢谢

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>

Try downgrading your react-scripts dependency to ^2.1.8 in your package.json file.尝试将 package.json 文件中的 react-scripts 依赖项降级到^2.1.8

It worked for me它对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM