coreybutler / nvm-windows

A node.js version management utility for Windows. Ironically written in Go.
MIT License
37.09k stars 3.3k forks source link

nvm installs node but fails to deliver npm #456

Closed dcoferraz closed 4 years ago

dcoferraz commented 5 years ago

My Environment

I'm using NVM4W version:

I have already...

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

Expected Behavior

After running nvm install latest that node version 12.5.0 and npm version v6.9.0 is installed.

Actual Behavior

After the install command, no errors are shown:

2019-07-03_09h10_55

the following issue occurs:

2019-07-03_09h11_08

The node_modules/ folder is empty:

2019-07-03_09h32_34

Steps to reproduce the problem:

Just install a version and check what happens. don't know exactly how this works but it seems to be something related to the new npm/cli project url change.

voltes-7777 commented 3 years ago

experienced the same issue with v1.1.5 but mine was installed via chocolatey and also had both nvm and nvm portable previously installed. uninstalled both via chocolatey then installed (not via choco) the current maintenance release 1.1.7. issue solved. glad i didnt hv to go the route of manually copying the folders.

thank you for this tool. hope it gets updated.

klepon commented 3 years ago

happen to me today using power shell, install node v9.9.0 no npm installed using command prompt uninstall node v9.9.0, install it again and all work well

samuelsons commented 3 years ago

Have the same problem. This is my attempt and works for me:

  1. download the need node version from https://nodejs.org/en/download/releases/ in zip format(or other format)
  2. Delete node_modules directory if it already exist in version drectory that located in nvm install directory(eg. C:\Users\USER_NAME\AppData\Roaming\nvm\v8.11.4).
  3. unzip the file from step 1, and copy node_modules directory to version directory infered in previous step.
  4. npm works

Worked for me!

samuelsons commented 3 years ago

I was getting a silent failure for installation of npm.

I thought it might be the Windows virus scanner, so I disabled that: image

Strangely now the failure is not silent:

$ nvm install 12.12.0
Downloading node.js version 12.12.0 (64-bit)...
Complete
Creating C:\ProgramData\nvm\temp

Downloading npm version 6.11.3... Download failed. Rolling Back.
Rollback failed. remove C:\ProgramData\nvm\temp\npm-v6.11.3.zip: The process cannot access the file because it is being used by another process.
Could not download npm for node v12.12.0.
Please visit https://github.com/npm/npm/releases/tag/v6.11.3 to download npm.
It should be extracted to C:\ProgramData\nvm\v12.12.0

NB: I did the two items below:

I also tried to install the version you couldn't achieve above, and it was successful, see screenshot below. Simply using the direct install command "nvm install v12.12.0"

v12 12

noel-schenk commented 3 years ago

https://techbrij.com/nvm-windows-node-npm-not-recognized#:~:text=During%20nvm%20installation%2C%20make%20sure,command%20and%20test%20it%20again.

This post helped me. Uninstall Node.JS, uninstall nvm, reinstall nvm

RonanCodes commented 3 years ago

This worked for me

meanOtaku commented 3 years ago

So I found the problem which is the realtime protection of windows image

disable it when installing node using nvm

Certiman commented 2 years ago

When using Norton 360, disabling its auto-protect allows installation of npm which is otherwise blocked.

psiservices-josh-valdivieso commented 2 years ago

I just ran

nvm uninstall NODE_VERSION

then

nvm install NODE_VERSION

and it brought npm back

tmushayahama commented 2 years ago

Something to check is make sure npm is not being used by another process when trying to update.

xiaoboRao commented 2 years ago

My Environment

  • [x] Windows 10

I'm using NVM4W version:

  • [x] 1.1.7

I have already...

  • [x] read the README to be aware of npm gotchas & antivirus issues.
  • [x] reviewed the wiki to make sure my issue hasn't already been resolved.
  • [x] verified I'm using an account with administrative privileges.
  • [x] searched the issues (open and closed) to make sure this isn't a duplicate.
  • [x] 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+?)
  • [x] A standard shell environment (terminal/powershell)
  • [ ] A non-standard shell environment (Cmder, Hyper, Cygwin, git)

Expected Behavior

After running nvm install latest that node version 12.5.0 and npm version v6.9.0 is installed.

Actual Behavior

After the install command, no errors are shown:

2019-07-03_09h10_55

the following issue occurs:

2019-07-03_09h11_08

The node_modules/ folder is empty:

2019-07-03_09h32_34

Steps to reproduce the problem:

Just install a version and check what happens. don't know exactly how this works but it seems to be something related to the new npm/cli project url change.

same case with yours, but when I run cmd as administrator, that problem disappeared !!!! and you can try to install a different node LTS version, good luck

dchima-ticketline commented 1 year ago

I had a fresh install of Windows 11 with no previous node installation. In my case the URLs nvm was trying to download from, e.g. https://github.com/npm/npm/releases/tag/v6.14.4 don't exist. I had to download node from https://nodejs.org/en/download/releases/ and unzip the contents to %APPDATA%\nvm\vNODE_VERSION Worked a treat after that

adamobrien4 commented 1 year ago

I had a variable in my system path for ".../yarn/bin/" and after removing that the issue has gone.