尝试运行命令npx创建反应应用程序时出现创建反应应用程序错误:衍生未知 [英] Create React App Error when trying to run command npx create react app: spawn UNKNOWN

查看:19
本文介绍了尝试运行命令npx创建反应应用程序时出现创建反应应用程序错误:衍生未知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试运行简单的npx create-react-app时,收到以下错误:

D:>npx create-react-app abc
npx: installed 67 in 4.255s

Creating a new React app in D:abc.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...


Aborting installation.
Unexpected error. Please report it as a bug:
Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:403:11)
    at Object.spawn (child_process.js:553:9)
    at spawn (C:UsersGilangAppDataRoaming
pm-cache\_npx17768
ode_modulescreate-react-app
ode_modulescross-spawnindex.js:12:24)
    at C:UsersGilangAppDataRoaming
pm-cache\_npx17768
ode_modulescreate-react-appcreateReactApp.js:407:19
    at new Promise (<anonymous>)
    at install (C:UsersGilangAppDataRoaming
pm-cache\_npx17768
ode_modulescreate-react-appcreateReactApp.js:359:10)
    at C:UsersGilangAppDataRoaming
pm-cache\_npx17768
ode_modulescreate-react-appcreateReactApp.js:485:16
    at processTicksAndRejections (internal/process/task_queues.js:93:5) {
  errno: -4094,
  code: 'UNKNOWN',
  syscall: 'spawn'
}

Deleting generated file... package.json
Deleting abc/ from D:
Done.

我使用的是Windows 10版本20H2和节点v14.15.4。

我也在官方create-react-appGitHubhere

发了一个问题

推荐答案

似乎写权限有问题。

尝试使用提升的权限从cmd运行npx create-react-app myapp,即以管理员身份运行cmd,然后尝试创建/搭建你的应用。

这篇关于尝试运行命令npx创建反应应用程序时出现创建反应应用程序错误:衍生未知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆