繁体   English   中英

运行命令时反应安装错误:npx create-react-app my-app

[英]React installation error while running command: npx create-react-app my-app

我想启动我的 React 应用程序,但在输入: npx create-react-app my-app后,它向我显示:

错误:产生未知
错误号:-4094,
代码:'未知',
系统调用:'spawn'

请检查截图: 中止安装。意外的错误。请将其报告为错误:错误:在 Object.spawn (node:child_process:689:9) at spawn (C:\Users\VAIBHAV\AppData) 在 ChildProcess.spawn (node:internal/child_process:413:11) spawn UNKNOWN \Roaming\npm\node_modules\create-react-app\node_modules\cross-spawn\index.js:12:24) 在 C:\Users\VAIBHAV\AppData\Roaming\npm\node_modules\create-react-app\createReactApp .js:383:19 at new Promise () at install (C:\Users\VAIBHAV\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:334:10) 在 C:\Users\VAIBHAV \AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:461:16 at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { errno: -4094, code: 'UNKNOWN' ,系统调用:'spawn'

你可以试试跑步

npm cache clean --force

然后再试一次。

如果问题仍然存在,请尝试使用安装 create-react-app 脚本

npm i -g create-react-app

并创建没有 npx 前缀的应用程序。

create-react-app存储库上有一个未解决的问题。

一些用户声称他们通过卸载他们的防病毒软件解决了这个问题。

我建议你可以试试。

这就是我解决它的方法:

  1. 卸载节点

  2. 删除C:/Users/[username]/AppData/Roaming/npmC:/Users/[username]/AppData/Roaming/npm/node_modules

  3. 删除C:/Users/[username]/.npmrcC:/Users/[username]/.node_repl_history

暂无
暂无

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

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