-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
Installing any module via npm after node installation deletes npm #606
Comments
Same here. I'm currently running on:
and it all works as expected. But I've just upgraded with added 1 package, removed 252 packages, and audited 2 packages in 4s
found 0 vulnerabilities Note the 252 packages removed. After that, the npm folder under %APPDATA%\nvm\v15.7.0\node_modules has been deleted. I can't see any reports of issues like this in the npm repository, so not sure yet if this is a npm or nvm problem. |
Like @davidgeary says, it happens, exactly that happens. I have also tried to update npm with the npm-windows-upgrade library as it is said somewhere in the documentation but it has not worked either |
Thanks for the info David, I tried 12.3.1 and it works. So I'm at least able to use npm again without hard installing a node version. As for me, npm-windows-upgrade didn't help either, I wouldn't expect it would. At first I didn't notice that it was counting the number of packages in npm that were uninstalled. But it's apparent by the # of modules removed that npm is literally uninstalling itself as if it was a dependency conflict, so it sounds like it's just a comically fatal regression of npm itself |
FYI, just installed 14.15.4 (node's latest active LTS version) with npm 6.14.10, and it too is working fine. |
Just to provide some insight: NVM4W doesn't touch npm at all during runtime. The only time NVM4W does anything with npm at all is during install/uninstall. It downloads/copies npm into the node directory and expects npm to do the rest. That said, there have been issues with npm hard-coding paths and partial paths into the npm code base. It's usually a failure to respect symlinks. Historically, the npm team hasn't been very responsive to my inquiries about these kinds issues, so I haven't had much luck tracking down the root cause when these kinds of issues arise. |
@coreybutler TBH, the fact that NVM4W works fine with 6.9.0 and 6.14.10 made me assume it was really an npm issue anyway (but I thought it worth adding my info here for the benefit of anyone else searching on this). I've just logged an issue in the npm repository - #2593 - in the hope that someone there can shed more light on it. |
Looks like it's an issue with npm. A new version of node (15.8.0) was released a few days ago that now includes npm 7.5.1. Installing this with NVM4W works correctly, so I'm guessing something was fixed in 7.5.x @aminomancer Can you try installing again with |
@davidgeary yeah, installing 15.8.0 on NVM4W works for me. great! |
Updating @Vue/CLI -g seemed to overwrite all installed global packages including npm. |
This issue is now happening with the current LTS version of node 16.13.0. When you try to do "npm update -g <any_package>" npm will just delete itself. I tested this for node versions of 17.1.0, 16.13.0, and 16.9.1 and the problem is there in all of those versions too. I tried going back to 14.16.1 and for that version it wouldn't delete itself. Do you guys have any plans on fixing this issue? |
Basically the steps are to install nvm, install the latest node, then npm i -g yarn or anything really. It successfully installs yarn but then npm disappears. The only module is now yarn so the npm command is missing. So I'd uninstall node with nvm and try again, but the same thing consistently happens. Tried reinstalling nvm, same thing. Tried installing different node versions, also to no avail. The STR are pretty simple so if this was affecting everyone I think it would have been more apparent. So maybe it's something wrong with my own environment, but it's not like I did anything unorthodox in the installation. Anyone familiar with this problem? Thanks
The text was updated successfully, but these errors were encountered: