-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Can't upgrade npm when using symbolic links #31111
Comments
@nodejs/version-management @nodejs/npm @platform-windows Would appreciate some help triaging this one. |
nvm does not support windows (perhaps nvm-windows, a different project?) and there’s no trace of a version manager in the error output, so i don’t think it’s related to version management at all. This seems like an issue with npm and symlinks on windows - have you tried filing an issue on npm’s repo directly? |
@ljharb I'm using nvm-windows. But I don't think that's the issue. To me, seems like something going wrong with the symlinks. The recent commit which I have referenced was supposed to fix this issue, but it looks broken. It deletes npm.exe basically and after that, there's no update as that file is required from what I understand. So I have to reinstall Node.js to solve this. Nope, I didn't file an issue on npm repo yet. I saw the PR here, so thought I'll mention here. |
The PR here just updates the default installed npm; the problem would have to be fixed in npm itself. Filing an issue there will likely have more effect :-) |
Thanks for the info. I shall make the issue in the npm repo. |
That's a permissions issue. Windows requires administrative privileges to execute anything within or write to the I'll also point out that the output looks like it's coming from a bash shell. I recommend first trying this in a normal terminal/powershell and assuring you have appropriate permissions. That should at least give you a starting point to rule out permission problems (as opposed to shell issues or npm issues). |
@coreybutler Yes you're right, I was using Git Bash at that time, but the output was same for all. I am using my personal laptop for this. I reinstalled Node.js v12.11.1 with npm v6.11.3 Here's output for Either this:
Or this:
|
@aravindvnair99 Did you reinstall with NVM4W or manually using the official msi? If you didn't uninstall NVM4W or an old version prior to the new installation, you'll likely run into npm version conflicts. See coreybutler/nvm-windows#300 (comment), which addresses the issue you're seeing. Like the error states, the workaround is to manually remove the files.... basically give npm a clear slate & start again. |
@coreybutler Thanks for the quick response. I didn't reinstall NVM4W, I only uninstalled Node 12.11.1 via coreybutler/nvm-windows#300 (comment) is what I have been doing for almost a year now. That works fine. But I'm still wondering why I am unable to update directly. It works fine when I'm using the official MSI, but not when using NVM4W. So, I thought it's something to do with the symlinks. My Node.js and npm works fine, just that |
@targos The issue still persists. |
Sorry, I forgot to leave a message. You should open an issue in the npm/cli repository. npm is not developed here. |
#30904 breaks dynamic links when using nvm.
npm install -g npm
outputs:C:\Program Files\nodejs\npx -> C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Program Files\nodejs\npm
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'
npm ERR! [OperationalError: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'] {
npm ERR! cause: [Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\Program Files\nodejs\npm'
npm ERR! },
npm ERR! stack: "Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'",
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path: 'C:\Program Files\nodejs\npm'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.
After which,
npm
outputs:bash: /c/Program Files/nodejs/npm: No such file or directory
And
npm.exe
has vanished:Related:
npm/bin-links#12
npm/gentle-fs#7
npm/cli@320ac9a
The text was updated successfully, but these errors were encountered: