无法运行npx create-react-app my-app:“ throw err0-” errno:-4048,系统调用:'mkdir',代码:'EPERM'

时间:2020-07-27 23:10:41

标签: reactjs create-react-app npx

我正在尝试在Windows上运行“ npx create-react-app my-new-app”,并遇到了以下错误,请提供帮助。

对于上下文,我首先运行npx create-react-app my-new-app时遇到问题,因为我的用户名带有空格(智能用户),所以我运行了npm i -g create-react-app然后再试一次-这产生了此错误:

$ npx create-react-app my-new-app
C:\Users\Smart User\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:45
        throw err0
        ^

Error: EPERM: operation not permitted, mkdir 'C:\Program Files\Git\my-new-app'        
    at Object.mkdirSync (fs.js:921:3)
    at Object.mkdirsSync (C:\Users\Smart User\AppData\Roaming\npm\node_modules\create-react-app\node_modules\fs-extra\lib\mkdirs\mkdirs-sync.js:31:9)
    at createApp (C:\Users\Smart User\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:230:6)
    at Object.<anonymous> (C:\Users\Smart User\AppData\Roaming\npm\node_modules\create-react-app\createReactApp.js:187:1)
    at Module._compile (internal/modules/cjs/loader.js:1137:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1157:10)
    at Module.load (internal/modules/cjs/loader.js:985:32)
    at Function.Module._load (internal/modules/cjs/loader.js:878:14)
    at Module.require (internal/modules/cjs/loader.js:1025:19)
    at require (internal/modules/cjs/helpers.js:72:18) {
  errno: -4048,
  syscall: 'mkdir',
  code: 'EPERM',
  path: 'C:\\Program Files\\Git\\my-new-app'
}

有什么想法吗?谢谢!

0 个答案:

没有答案