Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed With Code 7 #92

Closed
richardHaggioGwati opened this issue Jun 29, 2021 · 2 comments
Closed

Failed With Code 7 #92

richardHaggioGwati opened this issue Jun 29, 2021 · 2 comments

Comments

@richardHaggioGwati
Copy link

Error: EPERM: operation not permitted, mkdir 'C:\Users\Mr'
TypeError: Cannot read property 'get' of undefined
at errorMessage (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-message.js:38:39)
at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:201:13)
at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78: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:81:7
at Array.forEach ()
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80: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:171:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97
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\←[4mnpm←[24m\lib\utils\error-handler.js:97:27)
at process.errorHandler (C:\Program Files\nodejs\node_modules\←[4mnpm←[24m\lib\utils\error-handler.js:216:3)
←[90m at process.emit (events.js:321:20)←[39m
←[90m at process._fatalException (internal/process/execution.js:164:25)←[39m
Install for [ 'install-peerdeps@latest' ] failed with code 7

Each time I have attempted to try running the command, I am hitting this wall.

@richardHaggioGwati richardHaggioGwati changed the title failed with code 7 Failed With Code 7 Jun 29, 2021
@Asjas
Copy link
Contributor

Asjas commented Jun 29, 2021

@Trafalgarwaterdlaw Your issue seems to be caused by your Windows username having multiple words which contains spaces, the npx command has issues on Windows with those types of usernames.

I'll post a solution here that you can use for npx 🙂

if you want to use current path that has space in username
"C:\Users\Mr Something Else\AppData\Roaming\npm-cache"  
you can replace the string after space with "~1"

Example command:

npm config set cache "C:\Users\Mr~1\AppData\Roaming\npm-cache" --global

zkat/npx#146 (comment)

@richardHaggioGwati
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants