安装代码为7的创建Create React应用时出错 [英] Error installing create react app with code 7

查看:61
本文介绍了安装代码为7的创建Create React应用时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试使用命令行安装create react app时,这种类型的错误会逐渐蔓延。如何解决此问题?

This type of error creeps up when I am trying to install create react app with command line .How can I fix this problem ?

C:\Users\Rohit Mishra>npx create-react-app my-app
Error: EPERM: operation not permitted, mkdir 'C:\Users\Rohit'
TypeError: Cannot read property 'loaded' of undefined
    at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
    at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
    at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:77:20
    at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22)
    at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:83:7
    at Array.forEach (<anonymous>)
    at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:82:13
    at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
    at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:173:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98
  var doExit = npm.config.loaded ? npm.config.get('_exit') : true
                          ^

TypeError: Cannot read property 'loaded' of undefined
    at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
    at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3)
    at process.emit (events.js:198:13)
    at process._fatalException (internal/bootstrap/node.js:496:27)
Install for create-react-app@latest failed with code 7


推荐答案

之所以出现此问题,是因为您的计算机用户名之间有空格。
您可以通过不全局安装您的create-react-app软件包来解决此问题。

The issue is occurring because you have space between your computer username. You can resolve this by not installing your create-react-app package globally.

使用以下命令:-

1. npm cache clean --force
2. npm install create-react-app --force
3. npm fund
4. npx create-react-app <app-name> 

这篇关于安装代码为7的创建Create React应用时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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