-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
[BUG] EPERM error 4048 installing latest npm when on version 7.5.3 #2663
Comments
+1 with a variant that makes --global unusable after update. (Solved on >= 7.5.4)Current Behavior:Updating global with latest npm version 7.5.3 generates an error even on elevated privileges:
Expected Behavior:npm should be updated globally without error. Steps To Reproduce:
Environment:OS: Windows 10 x64 |
I am seeing this exact same problem. This should be a SEVERITY ONE. It can bork the entire node.js installation when npm goes belly up like this. I can confirm that I have checked permissions on the folder, tried running as Administrator, and ensure my AV product was disabled. |
@acohenOT can you try installing the latest |
7.5.4 solved it for the global update variant but in elevated mode when i have entered:
npm has deleted all the other packages in the global folders:
leaving only windows-build-tools.
|
I'm unable to install 7.5.4 because I get the error.
Does anyone know how to force the update to 7.5.4? |
@acohenOT in your case you may have to |
I'm running in a Windows command prompt so sudo will not work there. I'm already running cmd.exe with elevated privileges. |
@acohenOT for npm 7.5.4 on windows: |
running
|
@acohenOT thank you again for filing this. I've marked it as a high priority issue & will be looking at this again post the Apologize if you're still experiencing issues trying to install. We recommend using a Node Version Manager if you can (ex. Appreciate all the added context, we'll report back again early next week, ideally with a patch for this if we can get a reproduction case going. |
Hi people, I had the same problem yesterday. I updated NodeJS in my Win10 machine to What I did to fix it was to completely uninstall nodejs, check there were no files left in In conclusion, I think the problem is in version Thanks! |
Thank you @cristiammercado -- those steps worked for me as well! Definitely a problem with 7.5.3. |
Thank you @cristiammercado, this worked with node-v15.8.0-x64.msi as well wich came with npm version 7.5.1. |
the bug is, indeed, a problem in [email protected]. once you're on 7.5.4 you should be fine! if you're on 7.5.3 and stuck, and also have bash, you can try our bash script installer by running if you do not have bash, see the super helpful post above by @cristiammercado I'm going to close this issue since we do have multiple reports of the problem being fixed in 7.5.4, if anyone sees this problem happen when you already have 7.5.4 or newer installed, please open a new issue and let us know |
@nlf, I appreciate that this bug was fixed in 7.5.4, but the bug report was about being stuck on 7.5.3 and a full solution hasn't actually been addressed. How do you solve this problem if you are stuck on 7.5.3 and don't have bash? |
@robross0606, see the solution provided by @cristiammercado #2663 (comment) |
Okay, so basically nuke the entire installation and start over. |
I was facing the same problem for 3 days and got this solution for it... It's because of old files lying in your c drive: Follow the steps below and try, It will work for sure. problem: npm ERR! Errno: -4048, npm ERR! code: ‘EPERM’, npm ERR! syscall: ‘scandir’, solution: Uninstall node with node uninstaller ( find it from run cmd ) Then... Delete the npmrc file and delete the C:\Users\Administrator.npmrc file ( if don't find leave it ) Delete npm-cache folder from - C:\Users\Administrator\AppData\Roaming Delete npm folder from - C:\Users\Administrator\AppData\Roaming Restart your system and install fresh NodeJS and run this command in cmd: npm cache clean -–force to ensure the cache is cleared. That's your ready to go now... If you still face a problem feel free to get in touch with me @ishaiknadeem username on any platform |
tell me for windows 11 |
Current Behavior:
Installing latest npm version when on 7.5.3 generates an error:
Expected Behavior:
npm should be installed globally without error. If 7.5.3 is (still) the latest version, no change occurs
Steps To Reproduce:
npm i -g npm
Environment:
OS: Windows 10 x64
Node: 14.5.4
npm: 7.5.3
The text was updated successfully, but these errors were encountered: