nvmw icon indicating copy to clipboard operation
nvmw copied to clipboard

`nvmw install` fails on first attempt with "Can't get npm" error.

Open jamesshore opened this issue 9 years ago • 7 comments

When I run nvmw install, it fails the first time with a "Can't get npm" error. If I run the command again, it works. Windows 7 SP1.

Example 1:

c:\projects\weewikipaint>nvmw install 0.8.10
Start installing node/v0.8.10 (x32) to C:\Users\Jim\.nvmw\v0.8.10
Download from https://nodejs.org/dist/v0.8.10/node.exe, and save it as C:\Users\
Jim\.nvmw\v0.8.10\node.exe
Done
Start install npm
Download file from https://raw.githubusercontent.com/joyent/node/v0.8.10/deps/np
m/package.json
package.json
Content length is 2.66kb
Download 100%, 2.66kb / 2.66kb, 177.08kb/s ...
Donwload done
Download file from https://github.com/npm/npm/archive/v1.1.62.zip
v1.1.62.zip
Redirect: https://codeload.github.com/npm/npm/zip/v1.1.62
Download file from https://codeload.github.com/npm/npm/zip/v1.1.62
v1.1.62
Can't get 'content-length'
Can't get npm: https://github.com/npm/npm/archive/v1.1.62.zip

c:\projects\weewikipaint>nvmw install 0.8.10
Start installing node/v0.8.10 (x32) to C:\Users\Jim\.nvmw\v0.8.10
Download from https://nodejs.org/dist/v0.8.10/node.exe, and save it as C:\Users\
Jim\.nvmw\v0.8.10\node.exe
Done
Start install npm
Download file from https://raw.githubusercontent.com/joyent/node/v0.8.10/deps/np
m/package.json
package.json
Content length is 2.66kb
Download 100%, 2.66kb / 2.66kb, 2.59mb/s ...
Donwload done
Download file from https://github.com/npm/npm/archive/v1.1.62.zip
v1.1.62.zip
Redirect: https://codeload.github.com/npm/npm/zip/v1.1.62
Download file from https://codeload.github.com/npm/npm/zip/v1.1.62
v1.1.62
Content length is 1.75mb
Download 100%, 1.75mb / 1.75mb, 1.63mb/s ...
Donwload done
Download npm 1.1.62 is done
Start unzip "C:\Users\Jim\.nvmw\v0.8.10\npm.zip" to "C:\Users\Jim\.nvmw\v0.8.10"

The system cannot find the file specified.
C:\Users\Jim\.nvmw\v0.8.10\npm-1.1.62
        1 dir(s) moved.
        1 file(s) copied.
C:\Users\Jim\.nvmw\v0.8.10
npm install ok
Finished
Now using node v0.8.10 x32

c:\projects\weewikipaint>node --version
v0.8.10

Example 2:

c:\projects\weewikipaint>nvmw install 0.12.0
Start installing node/v0.12.0 (x32) to C:\Users\Jim\.nvmw\v0.12.0
Download from https://nodejs.org/dist/v0.12.0/node.exe, and save it as C:\Users\
Jim\.nvmw\v0.12.0\node.exe
Done
Start install npm
Download file from https://raw.githubusercontent.com/joyent/node/v0.12.0/deps/np
m/package.json
package.json
Content length is 4.32kb
Download 100%, 4.32kb / 4.32kb, 4.22mb/s ...
Donwload done
Download file from https://github.com/npm/npm/archive/v2.5.1.zip
v2.5.1.zip
Redirect: https://codeload.github.com/npm/npm/zip/v2.5.1
Download file from https://codeload.github.com/npm/npm/zip/v2.5.1
v2.5.1
Can't get 'content-length'
Can't get npm: https://github.com/npm/npm/archive/v2.5.1.zip

c:\projects\weewikipaint>node --version
v0.8.10

c:\projects\weewikipaint>nvmw install 0.12.0
Start installing node/v0.12.0 (x32) to C:\Users\Jim\.nvmw\v0.12.0
Download from https://nodejs.org/dist/v0.12.0/node.exe, and save it as C:\Users\
Jim\.nvmw\v0.12.0\node.exe
Done
Start install npm
Download file from https://raw.githubusercontent.com/joyent/node/v0.12.0/deps/np
m/package.json
package.json
Content length is 4.32kb
Download 100%, 4.32kb / 4.32kb, 287.83kb/s ...
Donwload done
Download file from https://github.com/npm/npm/archive/v2.5.1.zip
v2.5.1.zip
Redirect: https://codeload.github.com/npm/npm/zip/v2.5.1
Download file from https://codeload.github.com/npm/npm/zip/v2.5.1
v2.5.1
Content length is 3.12mb
Download 100%, 3.12mb / 3.12mb, 1.01mb/s ...
Donwload done
Download npm 2.5.1 is done
Start unzip "C:\Users\Jim\.nvmw\v0.12.0\npm.zip" to "C:\Users\Jim\.nvmw\v0.12.0"

The system cannot find the file specified.
C:\Users\Jim\.nvmw\v0.12.0\npm-2.5.1
        1 dir(s) moved.
        1 file(s) copied.
C:\Users\Jim\.nvmw\v0.12.0
npm install ok
Finished
Now using node v0.12.0 x32

c:\projects\weewikipaint>node --version
v0.12.0

jamesshore avatar Mar 06 '15 18:03 jamesshore

Same happens here. It always fails on first attempt with Can't get 'content-length'. @fengmk2 any ideas what goes wrong in first attempt?

am11 avatar Mar 08 '15 20:03 am11

+1, Can't get 'content-length' Can't get npm: https://github.com/npm/npm/archive/v1.4.23.zip

palamccc avatar Mar 25 '15 11:03 palamccc

I had the same problem, running CMD as administrator solved it for me. (I had to run it a couple times before it worked)

omerts avatar Mar 30 '15 09:03 omerts

+1 definitly same on me.

tgfjt avatar Apr 06 '15 08:04 tgfjt

+1

babsonmatt avatar Apr 08 '15 16:04 babsonmatt

@omerts got this issue on x64 Windows 8.1. Running CMD as admin worked for me.

adibsaad avatar Apr 08 '15 20:04 adibsaad

+1 I had a similar issue before and it would work on the second try, now says the version already exists and doesn't get npm along with node.

However if I run it once, leave the command window open, delete the newly installed node version folder and rerun it works as expected

andythecoderman avatar May 28 '15 12:05 andythecoderman