LoginSignup
4
0

More than 3 years have passed since last update.

【React】npx create-react-app my-appに失敗したとき ~ PCのユーザー名に空白があった時の対処法 ~

Posted at

エラーの内容を見た感じ、ユーザー名に空白が入っているのが原因っぽい

エラーメッセージ

ユーザー名がAAA BBBの時

C:\Users\AAA BBB>npx create-react-app my-app
Error: EPERM: operation not permitted, mkdir 'C:\Users\AAA'
TypeError: Cannot read property 'loaded' of undefined
    at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:98:27)
    ... (省略)
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)
    ... (省略)
Install for create-react-app@latest failed with code 7

解決法

stack overflow : https://stackoverflow.com/questions/56508244/error-installing-create-react-app-with-code-7

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

GitHub

GitHubでIssueが投げられていました
https://github.com/facebook/create-react-app/issues/6512

4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0