Skip to content
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

Cannot update npm (node 8.4.0) #300

Open
6 of 28 tasks
t0lkman opened this issue Sep 7, 2017 · 143 comments
Open
6 of 28 tasks

Cannot update npm (node 8.4.0) #300

t0lkman opened this issue Sep 7, 2017 · 143 comments

Comments

@t0lkman
Copy link

@t0lkman t0lkman commented Sep 7, 2017

If this is a question about how to use NVM4W, please use stackoverflow instead.

If this is an issue regarding antivirus, make sure you search the existing issues first.

My Environment

  • Windows 7 or below (not truly supported due to EOL - see wiki for details)

  • Windows 8

  • Windows 8.1

  • Windows 10

  • Windows 10 IoT Core

  • Windows Server 2012

  • Windows Server 2012 R2

  • Windows Server 2016

  • My Windows installation is non-English.

I'm using NVM4W version:

  • 1.1.6
  • 1.1.5
  • 1.1.4
  • 1.1.3
  • 1.1.2
  • 1.1.1
  • Older
  • OTHER (Please Specify)

I have already...

  • read the README to be aware of npm gotchas & antivirus issues.
  • reviewed the wiki to make sure my issue hasn't already been resolved.
  • verified I'm using an account with administrative privileges.
  • searched the issues (open and closed) to make sure this isn't a duplicate.
  • made sure this isn't a question about how to use NVM for Windows, since gitter is used for questions and comments.

My issue is related to (check only those which apply):

  • settings.txt
  • proxy support (Have you tried version 1.1.0+?)
  • 32 or 64 bit support (Have you tried version 1.1.3+?)
  • Character escaping (Have you tried version 1.1.6+?)
  • A standard shell environment (terminal/powershell)
  • A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

npm i -g npm@latest should install latest npm version

Actual Behavior

an error:
npm ERR! path C:\Program Files\nodejs\npm.cmd npm ERR! code EEXIST npm ERR! Refusing to delete C:\Program Files\nodejs\npm.cmd: is outside C:\Program Files\nodejs\node_modules\npm and not a link npm ERR! File exists: C:\Program Files\nodejs\npm.cmd npm ERR! Move it away, and try again.

Steps to reproduce the problem:

run as an administrator npm i -g npm@latest

@manuelbieh
Copy link

@manuelbieh manuelbieh commented Sep 7, 2017

Same problem here.

@kuncevic
Copy link

@kuncevic kuncevic commented Sep 10, 2017

I had the same issue, and here is how I got through :

run npm install -g npm and while it is running:
remove(backup) files npm.cmd and npm from c:\Program Files\nodejs\
remove(backup) .bin folder from c:\Program Files\nodejs\node_modules\npm\node_modules, then it should succeed
If you have Refusing to deleteissues with any other npm module files/folders you have to just remove these and restart update process. To restart copy npm.cmd back to c:\Program Files\nodejs\ . Then once npm install -g npm is running, remove npm.cmd, otherwise you get in to Refusing to delete npm.cmd issue, you might repeat that process until npm install -g npm is happy.

To remove the files you can use this shortcut: mv npm.cmd "c:\Program Files\nodejs\node_modules\npm\node_modules" as suggested by @farnetani

my env:
windows 7 x64, node 8.4, nvm 1.1.6

image

@alexgorbatchev
Copy link

@alexgorbatchev alexgorbatchev commented Sep 16, 2017

Seeing same problem

@cannap
Copy link

@cannap cannap commented Sep 17, 2017

same
windows 10
node 8.5.0
npm 5.3.0
nvm 1.1.0

@MichalLytek
Copy link

@MichalLytek MichalLytek commented Sep 22, 2017

@kuncevic
The easier solution is to copy dir node_modules/npm from the nodejs location, remove the npm bin and cmd, and run node npm-cli.js i -g npm@latest inside bin dir in the copied folder.

@wayofthefuture
Copy link

@wayofthefuture wayofthefuture commented Sep 23, 2017

So much for production. Good luck doing in a script.

@wayofthefuture
Copy link

@wayofthefuture wayofthefuture commented Sep 23, 2017

They should rename continuous integration to continuous intebreaktion

@wayofthefuture
Copy link

@wayofthefuture wayofthefuture commented Sep 25, 2017

@19majkel94 Couldn't get it working with your method... any other ideas which I could script?

@coreybutler
Copy link
Owner

@coreybutler coreybutler commented Sep 25, 2017

It appears as though npm has changed how it updates itself... without telling anyone. npx was also introduced with only a minor version change (as opposed to a major change).... which is semantically correct, but still hard to follow along.

Apparently there is some file sandboxing happening. I spent the better part of today investigating and attempting a fix, but each fix surfaces another issue. Bear with me, I'll get it fixed as soon as I can. I'm the only one working on this at the moment... and I happen to be in the middle of a different product launch (after 2yrs of work), so a PR would gladly be accepted.

@wayne-werner
Copy link

@wayne-werner wayne-werner commented Sep 26, 2017

I wish I could help, but I have an observation... I think that the issues are related to the shortcut to "C:/Program Files/nodejs". Perhaps if a junction were used instead of a shortcut? Windows can't tell the difference between a 'real' directory and a junction. So, it would look like node was really and truly installed in the default directory. No more 'operating' in a directory outside of the resolved directory.

https://docs.microsoft.com/en-us/sysinternals/downloads/junction

@wayne-werner
Copy link

@wayne-werner wayne-werner commented Sep 26, 2017

BTW, using a junction should future proof nvm4w against any future changes to npm's behavior.

@MichalLytek
Copy link

@MichalLytek MichalLytek commented Sep 26, 2017

@wayne-oscme
Have you read the readme?

The second option is to use a symlink. This concept requires putting the symlink in the system PATH, then updating its target to the node installation directory you want to use. This is a straightforward approach, and seems to be what people recommend.... until they realize just how much of a pain symlinks are on Windows. This is why it hasn't happened before.

In order to create/modify a symlink, you must be running as an admin, and you must get around Windows UAC (that annoying prompt). Luckily, this is a challenge I already solved with some helper scripts in node-windows. As a result, NVM for Windows maintains a single symlink that is put in the system PATH during installation only. Switching to different versions of node is a matter of switching the symlink target. As a result, this utility does not require you to run nvm use x.x.x every time you open a console window. When you do run nvm use x.x.x, the active version of node is automatically updated across all open console windows. It also persists between system reboots, so you only need to use nvm when you want to make a change.

@wayne-werner
Copy link

@wayne-werner wayne-werner commented Sep 26, 2017

@19majkel94
Please read about junctions. The 'symlink' aka window's shortcut has problems re resolution of target directory from processes. While window's explorer and terminal seem to handle them nicely, they aren't handled nicely in other processes. Open notepad, choose open file to get the standard window's file dialog. Navigate to "C:/Program Files/nodejs" and see where you end up.

Being a redirect to the target directory, which as we see is where processes end up, can lead to some interesting issues.

Junctions are the equivalent of hard links in *nix. Windows only supports these to directories, and not to files, but that's all we need here. They are not redirects. They are, for all intents and purposes, the directory, no different than the path created when the directory was first created.

They don't redirect, they are the destination. They can be deleted and created again with each 'use' command. Therefore, they will have the same effects and capabilities as shortcuts, but none of the downfalls that are creating the current problem.

@coreybutler
Copy link
Owner

@coreybutler coreybutler commented Sep 27, 2017

This has nothing to do with junctions/hard links/symlinks. @kuncevic provided a screenshot citing npm errors, the key part being Refusing to delete ... which is outside of ..... That is a hard-coded message in npm, preventing further operations. Bottom line: npm is refusing to full update itself.

This didn't seem to be an issue until npm 5.x.x, and I'm still digging through the details to figure out what has changed. I may have to write a workaround (i.e. hack), which I'm never fond of. I'm also looking into utilizing the msi packages, which seems to be the only way to get the attention of the folks at npm.

If you're in dire need of updating npm, you can download it via https://github.com/npm/npm/archive/vX.X.X.zip and extract it into the node_modules directory of your node installation root. You'll need to manually create a symlink in the node installation root to npm.cmd and npx.cmd. The final file structure should look something like:

nvm
- v8.5.0
   - node_modules
       - npm
          - bin
               - npm.cmd
               - npx.cmd
          ...
   - node.exe
   - npm.cmd (symlink to v8.5.0/node_modules/npm/bin/npm.cmd)
   - npx.cmd (symlink to v8.5.0/node_modules/npm/bin/npx.cmd)

@wayne-werner
Copy link

@wayne-werner wayne-werner commented Sep 28, 2017

@kuncevic
Copy link

@kuncevic kuncevic commented Sep 29, 2017

Just updated 5.4.1 → 5.4.2 with no issues.

c:\>npm install npm -g
C:\Program Files\nodejs\npx -> C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js
C:\Program Files\nodejs\npm -> C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
+ npm@5.4.2
removed 1 package and updated 2 packages in 12.125s

@coreybutler
Copy link
Owner

@coreybutler coreybutler commented Sep 29, 2017

@kuncevic - thanks... that's indicative the problem must be within npm 5.4.3+.

@wayne-werner
Copy link

@wayne-werner wayne-werner commented Sep 29, 2017

@doug2k1
Copy link

@doug2k1 doug2k1 commented Sep 29, 2017

For me it fails from Node 8.4.0 and up. It installs NPM 5.3.0, and then won't allow me to upgrade it.
Older Node versions (I have 4.8.4) allow NPM to update normally.

@manuelbieh
Copy link

@manuelbieh manuelbieh commented Oct 2, 2017

Man. npm 5 and nvm really sucks big time (but I blame npm 5 here since 4 works perfectly fine). I've downgraded to npm 4.6.1 last week and just tried to give 5.4.2 another try. Looks like npm has been uninstalled while trying to install react-native-cli, a completely different package:

Manuel@Manuel-406 /cygdrive/d/htdocs/wallet
$ npm install -g react-native-cli
C:\Program Files\nodejs\npx -> C:\Program Files\nodejs\node_modules\npm\bin\npx-cli.js
npm WARN Error: EPERM: operation not permitted, scandir 'C:\Program Files\nodejs\node_modules\npm\node_modules\libnpx\node_modules\yargs\node_modules\os-locale\node_modules\execa\node_modules\cross-spawn\node_modules\shebang-command\node_modules'
npm WARN  { Error: EPERM: operation not permitted, scandir 'C:\Program Files\nodejs\node_modules\npm\node_modules\libnpx\node_modules\yargs\node_modules\os-locale\node_modules\execa\node_modules\cross-spawn\node_modules\shebang-command\node_modules'
npm WARN   stack: 'Error: EPERM: operation not permitted, scandir \'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\os-locale\\node_modules\\execa\\node_modules\\cross-spawn\\node_modules\\shebang-command\\node_modules\'',
npm WARN   errno: -4048,
npm WARN   code: 'EPERM',
npm WARN   syscall: 'scandir',
npm WARN   path: 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\os-locale\\node_modules\\execa\\node_modules\\cross-spawn\\node_modules\\shebang-command\\node_modules' }
npm ERR! path C:\Program Files\nodejs\npm
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'
npm ERR!  { Error: EPERM: operation not permitted, open 'C:\Program Files\nodejs\npm'
npm ERR!   cause:
npm ERR!    { 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!   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!   parent: 'v8.5.0' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Manuel\AppData\Roaming\npm-cache\_logs\2017-10-02T14_54_04_833Z-debug.log

Manuel@Manuel-406 /cygdrive/d/htdocs/_git/wallet
$ npm install -g react-native-cli
sh: npm: Kommando nicht gefunden.

@yavorski
Copy link

@yavorski yavorski commented Oct 4, 2017

  • ubuntu: 16.04.2 LTS
  • nodejs: 8.6.0
  • npm: 5.3.0
npm i -g npm@latest

/home/user/.npm-global/bin/npm -> /home/user/.npm-global/lib/node_modules/npm/bin/npm-cli.js
/home/user/.npm-global/bin/npx -> /home/user/.npm-global/lib/node_modules/npm/bin/npx-cli.js
+ npm@5.4.2
added 68 packages, removed 164 packages and updated 14 packages in 14.307s

npm -v still prints 5.3.0 and it's not updated?

@coreybutler
Copy link
Owner

@coreybutler coreybutler commented Oct 4, 2017

@yavorski - this is nvm for Windows. I think you want nvm for *nix.

@coreybutler
Copy link
Owner

@coreybutler coreybutler commented Oct 4, 2017

I have confirmed this issue is sandboxing within npm 5.x.x. Prior editions of npm did not have this. Unfortunately, the fix is non-trivial, and judging by @yavorski's experience, it's not specific to this project.

@yavorski
Copy link

@yavorski yavorski commented Oct 5, 2017

Yep no nvm in my case. Linux + Nodejs from nodesource.

@larryboymi
Copy link

@larryboymi larryboymi commented Oct 20, 2017

Having same issue here...

@anandshenoy14
Copy link

@anandshenoy14 anandshenoy14 commented Mar 5, 2020

Was getting this Error on Windows and wanted to revert to an older npm for a project and in a very mild manner I just went to the already formed symlink location of npm command and renamed the npm folder in node_modules to its own version name and then downloaded the version I needed and created a folder called npm and dumped the downloaded contents there which worked!

@coreybutler your suggestion of creating a symlink did not work since windows complained that a symlink is already existing. Also in windows it is a pain to quickly edit a symlink. Also I needed to switch between the 2 versions of npm regularly. Hence I did this.

@jakobrosenberg
Copy link

@jakobrosenberg jakobrosenberg commented Mar 22, 2020

I just renamed these files to "1"
npm1.cmd, npm1, npx1, npx1.cmd
and ran:
"npm1 update -g"

Just rename the file npm1.cmd, it's enough. Then run the npm update.

No need to use npm-windows-upgrade.

@xmedeko @chidveer Maybe I'm missing something here, but isn't npx npm-windows-upgrade more straight forward than manually renaming files before running npm update?

@xmedeko
Copy link
Contributor

@xmedeko xmedeko commented Mar 22, 2020

@jakobrosenberg npm-windows-upgrade has not worked for me. Maybe I did something wrong, maybe I did attempted upgrade, or whatever. IMO one file rename is simpler than to study, why npm-windows-upgrade is not working and how to fix it.

Note: it's recommended to use npm-windows-upgrade globally, so you run it as npm-windows-upgrade, not npx npm-windows-upgrade.

@jakobrosenberg
Copy link

@jakobrosenberg jakobrosenberg commented Mar 22, 2020

@xmedeko wouldn't npx npm-windows-upgrade run globally unless you're inside a node project with a local installation of npm-windows-upgrade?

@xmedeko
Copy link
Contributor

@xmedeko xmedeko commented Mar 23, 2020

@jakobrosenberg Yes, you are right, I didn't know npx behave like that, I always use it for local project packages only.

@nokidding
Copy link

@nokidding nokidding commented Mar 31, 2020

A batch script which works fine.
https://gist.github.com/nokidding/aafaf90adc80cbce54b676340817bb13

@ses403
Copy link

@ses403 ses403 commented Apr 3, 2020

works like charm
just be sure 'set node_path=!PROGRAMFILES!\nodejs' is pointing correct path in your case
specifically incase of no standard installation(zip extract)

@ganselmo
Copy link

@ganselmo ganselmo commented Jul 11, 2020

Same Issue!
how i solved it:

  1. Control Panel=>Uninstall a program
  2. Delete NodeJS app
  3. Delete All NodeJS Folder on program Files
  4. Fresh Install Node JS

@Obiwarn
Copy link

@Obiwarn Obiwarn commented Oct 7, 2020

I just needed Step 4, i.e. Just download and fresh install Node JS.
Then it worked.

@patricknelson
Copy link

@patricknelson patricknelson commented Oct 14, 2020

Reinstalling the node version works fine, but since this is an issue associated with nvm, why not use the power of nvm to fix the problem? For me, instead of going through add/remove programs, it was way quicker/simpler to keep it all in the command line. For example:

nvm uninstall VERSION
nvm install VERSION

After that, close and re-open the shell. Quick and easy (now that you know, at least). 😄

If you have any issues (e.g. nvm indicates that the version is already installed), then check to see if the folder associated with that version still exists (e.g. %NVM_HOME%\VERSION) and that the file node.exe isn't still there. If it is still there, make sure you didn't already have any apps potentially running node (e.g. in my case my IDE was running it, so I closed that and was able to completely remove).

EDIT: ⚠️ I suppose this simple solution comes with one important side effect: It will remove your globally installed packages... hmm... may still be simpler to manually reinstall those. Be warned! ⚠️

@sandyfigueroa
Copy link

@sandyfigueroa sandyfigueroa commented Nov 23, 2020

@liuliangsir
Copy link

@liuliangsir liuliangsir commented Dec 23, 2020

This powershell script works perfect: #300 (comment)

Thanks!

@bladeoflight16
Copy link

@bladeoflight16 bladeoflight16 commented Jan 9, 2021

@ganselmo If you're installing via the Control Panel, you're not using nvm. You need to uninstall that version before you even install nvm.

@bladeoflight16
Copy link

@bladeoflight16 bladeoflight16 commented Jan 9, 2021

@jakobrosenberg

wouldn't npx npm-windows-upgrade run globally unless you're inside a node project with a local installation of npm-windows-upgrade?

This uses the npx executable script that you're trying to update, so it's likely to fail due to locking the file.

@begin-again
Copy link

@begin-again begin-again commented Feb 9, 2021

I got this work by renaming npm.cmd to npm1.cmd and then deleted other npm files: npm, npx.cmd, npx. Then I ran npm1 install -g npm

@MuhammadAbbasAkhtar
Copy link

@MuhammadAbbasAkhtar MuhammadAbbasAkhtar commented Feb 16, 2021

I had the same issue, and here is how I got through :

run npm install -g npm and while it is running:
remove(backup) files npm.cmd and npm from c:\Program Files\nodejs\
remove(backup) .bin folder from c:\Program Files\nodejs\node_modules\npm\node_modules, then it should succeed
If you have Refusing to deleteissues with any other npm module files/folders you have to just remove these and restart update process. To restart copy npm.cmd back to c:\Program Files\nodejs\ . Then once npm install -g npm is running, remove npm.cmd, otherwise you get in to Refusing to delete npm.cmd issue, you might repeat that process until npm install -g npm is happy.

To remove the files you can use this shortcut: mv npm.cmd "c:\Program Files\nodejs\node_modules\npm\node_modules" as suggested by @farnetani

my env:
windows 7 x64, node 8.4, nvm 1.1.6

image

Its been 3 years since this reply, but it still works!
Thank you so much

@alekslario
Copy link

@alekslario alekslario commented Feb 23, 2021

This was my fix:
1.Uninstall npm, node, remove all related directories.
2. Remove nvm bloat if any left
3. Install Volta
4. Everything works out of the box + build in rust
5. ???
6. Profit

@onx2
Copy link

@onx2 onx2 commented Feb 26, 2021

This was my fix:
1.Uninstall npm, node, remove all related directories.
2. Remove nvm bloat if any left
3. Install Volta
4. Everything works out of the box + build in rust
5. ???
6. Profit

Feels kind of mean to offer another package as a solution... but this absolutely worked out of the box for me and I love Rust. Thanks for the info @alekslario

@maximborisov
Copy link

@maximborisov maximborisov commented Mar 2, 2021

I modified this answer for node 15.10.0 and npm 7.5.3 and it very helpful for me. I added one another step for renaming npx too

cd %APPDATA%\nvm\v15.10.0           # or whatever version you're using
mv npm npm-old
mv npm.cmd npm-old.cmd
mv npx npx-old
mv npx.cmd npx-old.cmd
cd node_modules\
mv npm npm-old
cd npm-old\bin
node npm-cli.js i -g npm@latest

@median-dxz
Copy link

@median-dxz median-dxz commented Mar 4, 2021

Another idea I've tried (I don't know if anyone has already mentioned it) is to install npm directly without using npm itself. Refer to npmjs in the “Direct Download” section, and it works.

@GorvGoyl
Copy link

@GorvGoyl GorvGoyl commented Mar 13, 2021

A batch script which works fine.
https://gist.github.com/nokidding/aafaf90adc80cbce54b676340817bb13

This works. To use:

  1. download this as updateNpm.bat file
  2. open powershell in that same folder and run this command ./updateNpm.bat latest

@spaciandd
Copy link

@spaciandd spaciandd commented May 18, 2021

A batch script which works fine.
https://gist.github.com/nokidding/aafaf90adc80cbce54b676340817bb13

This works. To use:

  1. download this as updateNpm.bat file
  2. open powershell in that same folder and run this command ./updateNpm.bat latest

That worked for me, at last.

Thank you

@relu91
Copy link

@relu91 relu91 commented Jul 26, 2021

nvm for Linux has this install-latest-npm command, maybe it is worth integrating the script above in nvm-windows as well.

@nsmithdev
Copy link

@nsmithdev nsmithdev commented Dec 29, 2021

For me I only get the problem when updating npm from npm v6.
So using a newer version of npm via npx to run the upgrade works for me.

For the newest version
npx npm install -g npm

Or use a specific version
npx npm@7 install -g npm@7

@SuperDzej
Copy link

@SuperDzej SuperDzej commented Jan 11, 2022

Hi guys, have also problem to report after Windows reinstall can't seam to get latest npm for nvm node version 6.12.0 which I need to use, tried nvm version 1.1.9 and 1.1.7, it keeps failing with:

C:\Program Files\nodejs
`-- (empty)

npm ERR! Windows_NT 10.0.19042
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "npm"
npm ERR! node v6.12.0
npm ERR! npm  v3.10.10
npm ERR! path C:\Program Files\nodejs\node_modules\.staging\@gar\promisify-f70bb42b
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Program Files\nodejs\node_modules\.staging\@gar\promisify-f70bb42b' -> 'C:\Program Files\nodejs\node_modules\npm\node_modules\@gar\promisify'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Program Files\nodejs\node_modules\.staging\@gar\promisify-f70bb42b' -> 'C:\Program Files\nodejs\node_modules\npm\node_modules\@gar\promisify'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     C:\WINDOWS\system32\npm-debug.log
npm ERR! code 1

Tried all methods above all lead to this issue. Tried to make this folders, but it starts adding packages and then folder disappears and get same error. Tried installing this promisify globally doesn't help, on version 14.18.3 I'm able to update npm with that method to rename npm folder and execute that npm script in bin folder but on this no. After I do npm install it totally nukes whole npm and you can't use command anymore it throw error as whole bin folder it gone.

Tried separate 6.12.0 download from node, deleted nvm, it seams this is node issue, not nvm itself.

Latest update, I managed to update with specific version like 5.7.1, as I needed min npm version 5 so I guess will go with that if anyone needs it. Command I used was:

npm i -g npm@5.7.1

@dschulten
Copy link

@dschulten dschulten commented Jan 13, 2022

This was my fix: 1.Uninstall npm, node, remove all related directories. 2. Remove nvm bloat if any left 3. Install Volta 4. Everything works out of the box + build in rust 5. ??? 6. Profit

Note that you need to enable Windows Developer Mode to allow Volta to set symlinks. Otherwise you get issues with access privileges similar to nvm. I have switched to Volta now but that might be helpful for nvm, too.

@devtobee
Copy link

@devtobee devtobee commented Jan 26, 2022

Just delete the folder ...\AppData\Roaming\npm and \AppData\Roaming\npm-cache.
then try
npm install -g npm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet