-
Notifications
You must be signed in to change notification settings - Fork 822
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
NPM Install - Rename Error #2097
Comments
@russalex Take a look, please? This is in build 15063. I've seen this happen when running an "npm install" on an actual source tree that's pulling in quite a few packages. npm will install packages, and will fail some of the way through with EACCESS during rename. Please let me know whether you'd like an example. I can point you towards the github of the source tree that caused this in my environment. |
My thoughts, exactly. Although I have adjusted my development workflow to reduce the need to call |
Spoke too soon. Issue occur again while running |
@sgtoj , this appears resolved in build 16215. Can you confirm? |
@sunilmut The issue discussed here happens when pulling in a whole bunch of packages that are part of a javascript project. You can use 'npm init' to be walked through creating a dummy package.json if you want to test just installing one package, see https://nodesource.com/blog/your-first-nodejs-package/ If you want to see 'npm install' grabbing a whole bunch of packages, you could fork a javascript project. The one I'm using for testing is at https://github.com/symposion/roll20-shaped-scripts . Fork that, clone it locally, and have at it with 'npm install' (note that this package relies on a private repo for 'npm test' to work, it's normal for 'npm test' to fail out of the box on this one). |
I can also confirm that simply closing VSCode (or whatever editor/ide one might have that working folder opened in) allows for But this is still a bummer... Having to close the editor means we can't use bash through the integrated terminal that VSCode offers. Windows 10 Pro, Version 1703, Build 15063.413 |
@sunilmut I just had this happen to me again in 16232. Running 'npm install' a second time, it completed. There's definitely some form of timeout or race condition here. |
Getting this error as soon as i try to update any sort of package, or install a package which seems to have an already existing dependency installed. I have tried the following:
Each time the npm update fails, npm then in return gets removed and I have to reinstall the whole node version to get npm back
|
@MrCroft The problem for me is that it happens even among the global node modules. I also tried to update the files locally in the global modules folder, as suggested by the accepted answer at stackoverflow, but it doesn't work... At least that may be a good thing, compared to the odd behavior you're experiencing with the editor/ide? |
@felixnorden Have you tried this in Insider build 16251? I just tested again, opening two bash windows and running npm install on two separate projects at the same time to really stress the system - and it worked without a hitch. Since the issue is intermittent, I think 16251 needs more testing before we can say "this appears to be fixed now." |
@yorickdowne No, I'm on build 15063.502. Maybe I'll try that and I'll get back with the results! |
@felixnorden Be sure to test on a separate install / partition. Insider builds can be temperamental. |
@yorickdowne After the update things seem to be working fine. I've tried to do multiple clean installs of different node versions, updating both npm and other global packages and only did it fail once (the first time), which instead gave an |
So I ended up having the same issue, and realized I had two conflicting NPM versions on my computer.
The cause of the issue was doing both |
@kaiwah wow, never tried that. Didn't realize you could have 2 versions of npm at the same time :) Plus... I use Sent from my Samsung SM-G950F using FastHub |
@MrCroft yup! I use NVM now as well to swap between node versions. But when I first installed, I assumed And I love WSL, but unfortunately it seems I will be going back to either Ubuntu native or GitBash as the WSL file system is too slow doubling my build times. |
I'm new to npm, so I don't know how much of a solution this is for a more experienced user, but it works for me. The mensioned problem:
Intructions according to source:
+ terminal restart |
@bart5, those instructions are for installing global npm packages without the need for sudo, by pointing npm at a local user directory for global files. The issue discusses here is for local, not global, npm install, only happens when a large amount of packages are being installed, and appears to be some kind of timeout or race condition. And it appears it's fixed in all the current Insider builds. |
This may be resolved? I haven't had any issues for awhile. Edit: Using Windows 10 Insider's Build 16275 |
Is this likely to address a similar issue in Docker-for-Windows, running npm on a mounted volume from the host?
|
I am also facing same Issue with WSL Ubuntu in Windows v1709 (build 16299.15) `npm ERR! Linux 4.4.0-43-Microsoft npm ERR! ENOTEMPTY: directory not empty, rename '/mnt/d/Projects/v2/ui/node_modules/leek' -> '/mnt/d/Projects/v2/ui/node_modules/.leek.DELETE' npm ERR! Please include the following file with any support request: |
It looks like the original report, @amit-srivastava-007 & @Jefftopia - your |
I have been experiencing what I believe to be the same issue with However, at this point I've had to resort to rebooting Windows when I start getting
I was going to attach the output of WSL running I'm running Windows Version 1709 (OS Build 16299.125) |
I can also confirm that closing VSCode (the native linux one running in WSL) allows the npm install to run without error and I'm running Windows build 17074.rs_prerelease_flt.180116-1539. Side note, mine is not a global install just a local install. |
Just wanted to add fuel to the fire here. I have confirmed that closing VSCode works for me, but that is still not acceptable. I don't know a ton about lower level programming, symlinks, OS programming, etc. as a lot of you seem to have, but considering that in the past with things like the Bash terminal that used MYSYS2 haven't worked properly, I am not surprised that a Windows Linux implementation still doesn't work. Don't get me wrong, I think it's awesome that I can use my natural instinctive linux commands. Honestly the only issues I have had with WSL are that I can't do multiple tabs with CMD (MobaXterm isn't a good replacement either with the hotkeys compared to Ubuntu 18.04) and this npm issue. However, it's obvious that this Ubuntu "subsystem" is still subject to all of Windows's woes. It's a shame this hasn't been fixed after having multiple issues open for over 3 years, but I guess Hopefully this gets fixed at some point. I really love being able to develop on Windows as the Ubuntu Gnome UI isn't the best in comparison, but these small headaches add up to a poor experience. I haven't been developing for long, but I know a speed bump in workflow is a serious motivation killer. |
I solved this by mounting C:/ with default permissions bound to my user instead of root. I followed the guide here: https://devblogs.microsoft.com/commandline/chmod-chown-wsl-improvements/
This mounts all files on the C drive as my user instead of root. Therefore sudo is not needed to run |
Still seeing this today. |
Still having this issue |
+1 |
This issue occurs for me when the number of dependencies I install reaches a certain point. Its almost as if the filesystem isn't able to keep up and falls behind at a certain point. Very strange. |
I have this problem, and I do not use VSCode. It occurs when I I use https://github.com/tj/n to manage my node install (with I don't know if it's related, but I recently ran |
#4537 was given different treatment because it's a BSOD, and thus given some hope a minidump will make it's way though the works somehow. That the underlying problem experienced in this thread is #1529 + #1956 has been covered a few times. The OP repro was:
Which you'll almost certainly find works. Hence the closed status here. This goes double for WSL2 which addresses #1529 on ext4. [Notwithstanding someone (paraphrasing) "taking the better part of a day's effort to narrow a test case to something reproducible and actionable, in the (very small but nonzero) chance it was possible to demonstrate a problem that was not #1529 or #1956". The caveat being largely academic, mind, at least until those two flip status.] |
I appreciate the work you're doing here. I just wanted to leave a signpost for future travelers who, like me, found this issue first, and were frustrated to discover it was closed, despite the steady stream of "me too" replies. The root cause seems to be under investigation, even if this higher level issue is closed. Upon closer inspection, I see you provided links to some potentially related issues earlier in the thread. I missed those links on my first quick read through. |
@kdolan Thank you solved my problem!
|
Just encountered this issue after reinstalling WSL, and none of the listed solutions seem to be working. Here's my logs: |
Issue here too. Closing VSCode and redoing npm install from WSL directory went ok. Not ideal at all and I hope the team can find a solution to this. It interrupts the normal workflow with Node. |
Thanks @jacobopolavieja |
When I read this answer I realized that this issue only happened to me after I open VSCode from WSL. Reboot Windows worked fine for me, thanks @suprsidr. I think it could be a problem with the WSL extension of VSCode. |
This issue still exists for me. |
The cause of the issue for me was having a out of date package installed, in the package.json.
|
same here. freshly installed windows 10 (build 18363), node 12 installation using nvm, just rebooted, vsc is not started, trying to install latest npm - getting the same error. |
FWIW: Working in Docker (from WSL) largely solves these issues and is good practice for any number of reasons so perhaps that's a workaround that may make sense for you also? WSL went from unusable to more-than-sufficient. Also, working directly with the FS in WSL is slow while Docker runs in Windows-proper so it's FAR faster (especially for |
My colleague was having the same "rename error eacess" errors, but we found that he has been using a Ubuntu 16.04 WSL version. After uninstalling it and installing Ubuntu 18.04 WSL version, the problem ceased. The command which originated the issue was |
In my case I was having 2 npm versions installed. One version was installed on WSL , another one on Windows. After removing Windows version I`ve got no errors yet.. |
I'm having the same issue on WSL 2, the project folder is in my home directory, not a mounted NTFS partition. Not even restarts or using sudo help. Edit: never mind, turns out my distro was on WSL 1. Also, seems like this was caused by the VS Code file watcher in my case. https://code.visualstudio.com/docs/remote/wsl#_i-see-eaccess-permission-denied-error-trying-to-rename-a-folder-in-the-open-workspace |
One thing you might want to try is disable the vscode's file watcher on node_modules. We have an older project that still uses gulp and part of the gulp serve:dev command was to rm -rf ./dist since vscode was watching ./dist it failed files.watcherExclude": {
"**/dist/**": true,
"**/shared/**": true,
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/**": true
} |
WSL v1, Win 10 (1909) build 18363.778, Ubuntu 18.04 I had a clean system and updated node from default 8 to 12.x with
Tried to close VS Code and use just a console - no immediate success.
|
For me, the following 2 solutions worked -
|
Turn on file polling in VSCode or use WSL 2. |
@therealkenc Still having exactly this issue and many others are too. Any reason this isn't in your backlog? |
Windows Build
Microsoft Windows [Version 10.0.16193.1001]
Cause
Running
npm
install against apackage.json
and/or a single install (typescript
ortslint
).Problem
TL;DR: Appears that #14 issue has returned.
On two different computers with the same build,
npm
has fails to installed packages due npm not able to moving it fromnode_modules/.staging/
tonode_modules/
. It's not limited to specific module. The real catch is, if I reboot the system and try again, the issue is resolved. In the last build, when this happen I would closed all editor windows and kill any running conhost, cmd, and bash process then retry with mostly success. Now the issue see to be more frequent and system must be rebooted to resolve.NPM Error Example
Strace
4.6k Line Trace
The text was updated successfully, but these errors were encountered: