-
-
Notifications
You must be signed in to change notification settings - Fork 105
Error: EPERM: operation not permitted, mkdir 'C:\Users\Foo' #100
Comments
@Meeeeow could you post the actual terminal output for this, please? I'm not exactly sure which place it's coming from with just this info. |
|
Thanks! This looks like a bug in npm itself. I'll look into it! |
I had the similar issue. Got fixed just by cleaning the npm cache.
|
Error: EPERM: operation not permitted, mkdir 'C:\Program Files\Java\JDK.ioni |
can anyone tell me how to fix this ???? |
npm clean cache doesn't work. No NPM commands work. They are all result in this same error. Even npm -v |
running cmd through administrator works for me |
I noticed that the path in the error message cut off prior to the first space. The path to my user folder is 'C:\Users\Paul Cyr'. Environment: Windows 10 Build 15063.726
|
Changing the command from |
I have the same problem but I have only encountered it with 2 modules so far. OS: Windows 10 |
I was hit with the same problem, same backtrace, and for the same reason as the OP . |
Any update on when the fix for this will be included? It is popping up through more and more modules |
I also have this issue, although it is failing on mkdir of a username with a space in it, that is not on my computer. Is this a config setting I should change (maybe it somehow mixed up user config that I had on an old computer)? Fixed |
I think you should excute this command on administrator "npm config set prefix path/to/Actual_npm_folder" |
any news if there ways to resolved the issue regarding user profile paths with spaces. |
i m also facing same problem TypeError: Cannot read property 'get' of undefined TypeError: Cannot read property 'get' of undefined not any single npm command work |
I'm still having the problem. Now with TypeScript as well. Exactly the same error as the ones above. |
Jumping in..
|
Seeing the same behavior here with respect to paths with spaces. Appears to be limited to npx. Output as follows for directory
|
Am I reading this right, that there's a fix (#138) but until it gets merged, |
I have the same issue, but I'm on a Mac and I have no spaces in my home directory. Node is installed in /usr/local/.... Note that this problem goes away if I install using sudo NPM Version 5.6 |
Hi I got the same issue following solved mine |
I found these solutions, which worked for me! You need to change the cache to a location without spaces. |
I was also facing the same problem while following react tutorials. Following steps worked for me
After this I ran the npx command shown in tutorial, and it worked. Hope this helps. |
Workarounds aside, is there any chance this gets fixed? The issue is quite old, but the issue still remains. |
My user name was "C:\Users\Carolina Maciel" i used: 1º)cmd /c mklink /J "C:\Users\myname" "C:\Users\My Name" if not work, use: Worked for me, hope helps for u! |
@carolinamaciel1 Thanks, but as I said, this is a workaround. There is a PR request readily available, which only needs to be merged to REALLY fix this problem. @zkat My hope is on you ;-) Any change you could merge PR #181 ? |
I'm searching for like an hour and finally, you made it nicely, thank you so much |
run cmd in administrator then npm cache clear --force |
npm cache verify i'm have a try!! |
This worked for me as well (still having space in my username on Windows 10) |
Moo PS C:\dev> npx cowsay hi
Error: EPERM: operation not permitted, mkdir 'C:\Users\Lewis'
TypeError: Cannot read property 'loaded' of undefined
at exit (C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:98:27)
at errorHandler (C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:216:3)
at C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js:77:20
at cb (C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\npm.js:225:22)
at C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\npm.js:263:24
at C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:83:7
at Array.forEach (<anonymous>)
at C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:82:13
at f (C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\config\core.js:173:20)
C:\Users\Lewis Moten\AppData\Roaming\npm\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:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:98:27)
at process.errorHandler (C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\npm\lib\utils\error-handler.js:216:3)
at process.emit (events.js:189:13)
at process._fatalException (internal/bootstrap/node.js:496:27)
Install for cowsay@latest failed with code 7
PS C:\dev> npx -v; npm -v; node -v
6.9.0
6.9.0
v10.15.3
PS C:\dev> npm i cowsay -g
C:\Users\Lewis Moten\AppData\Roaming\npm\cowsay -> C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\cowsay\cli.js
C:\Users\Lewis Moten\AppData\Roaming\npm\cowthink -> C:\Users\Lewis Moten\AppData\Roaming\npm\node_modules\cowsay\cli.js
+ cowsay@1.4.0
added 10 packages from 3 contributors in 1.596s
PS C:\dev> npx cowsay hi
____
< hi >
----
\ ^__^
\ (oo)\_______
(__)\ )\/\
||----w |
|| ||
PS C:\dev> |
Escaping the slash this way worked for me. Thank you very much. I'm also on windows 10. I do not have a space in my user name. This problem started for me after calling this: After the above I tried calling this and then I saw the error:
This line in my .npmrc file fixed it for me: |
Resolvido com esse código. |
Thank you my lord! Saved a day of headaches! |
Environment: Windows 10
npx Version: 9.4.1
See also: #84
Reason:
My user home directory contain whitespace, like
foo bar
The text was updated successfully, but these errors were encountered: