Cannot upgrade from npm@~1.2 to npm@1.4.4 on Windows 7 #4809

Closed
bryanburgers opened this Issue Feb 28, 2014 · 8 comments

Comments

Projects
None yet
6 participants
@bryanburgers
Contributor

bryanburgers commented Feb 28, 2014

On Windows 7, using git bash.

$ npm version
{ http_parser: '1.0',
  node: '0.10.3',
  v8: '3.14.5.8',
  ares: '1.9.0-DEV',
  uv: '0.10.3',
  zlib: '1.2.3',
  openssl: '1.0.1e',
  npm: '1.2.17' }
$ npm install npm -g
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
C:\Users\bryan\AppData\Roaming\npm\npm -> C:\Users\bryan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm WARN unmet dependency C:\Users\bryan\AppData\Roaming\npm\node_modules\npm\node_modules\npm-registry-client requires semver@'^2.2.1' but will load
npm WARN unmet dependency C:\Users\bryan\AppData\Roaming\npm\node_modules\npm\node_modules\semver,
npm WARN unmet dependency which is version 2.2.1
npm@1.4.4 C:\Users\bryan\AppData\Roaming\npm\node_modules\npm

I tried to update to npm@1.3.0 to see if a 1.3 → 1.4.4 update would go smoother. But when I performed an install npm@1.3.0, it apparently updated a different npm in a different folder.

$ which npm
/c/Program Files/nodejs/npm

$ npm -v
1.2.17

$ npm install npm@1.3.0 -g
npm http GET https://registry.npmjs.org/npm/1.3.0
npm http 304 https://registry.npmjs.org/npm/1.3.0
npm http GET https://registry.npmjs.org/normalize-package-data
npm http 304 https://registry.npmjs.org/normalize-package-data
npm http GET https://registry.npmjs.org/semver
npm http GET https://registry.npmjs.org/github-url-from-git
npm http 304 https://registry.npmjs.org/semver
npm http 304 https://registry.npmjs.org/github-url-from-git
C:\Users\bryan\AppData\Roaming\npm\npm -> C:\Users\bryan\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm@1.3.0 C:\Users\bryan\AppData\Roaming\npm\node_modules\npm
└── normalize-package-data@0.1.7 (github-url-from-git@1.1.1, semver@1.1.4)

$ npm -v
1.2.17
@bryanburgers

This comment has been minimized.

Show comment
Hide comment
@bryanburgers

bryanburgers Feb 28, 2014

Contributor
$ which npm
/c/Program Files/nodejs/npm

That doesn't match where npm@1.3.0 was downloaded, which is probably the issue. What's the best way to resolve this?

Contributor

bryanburgers commented Feb 28, 2014

$ which npm
/c/Program Files/nodejs/npm

That doesn't match where npm@1.3.0 was downloaded, which is probably the issue. What's the best way to resolve this?

@jakub-g

This comment has been minimized.

Show comment
Hide comment
@jakub-g

jakub-g Feb 28, 2014

Contributor

You can rename/delete npm and npm.cmd in /c/Program Files/nodejs or change the order of items in your PATH (right now /c/Program Files/nodejs/npm is before your local npm folder).

However when you update node, the files in former folder will get recreated probably.

Contributor

jakub-g commented Feb 28, 2014

You can rename/delete npm and npm.cmd in /c/Program Files/nodejs or change the order of items in your PATH (right now /c/Program Files/nodejs/npm is before your local npm folder).

However when you update node, the files in former folder will get recreated probably.

@bryanburgers

This comment has been minimized.

Show comment
Hide comment
@bryanburgers

bryanburgers Feb 28, 2014

Contributor

Update:

npm@1.3.0 did install correctly in a different folder. From that, I was able to install npm@1.4.4, and it replaced my original npm.

$ cd /c/users/bryan/AppData/Roaming/npm
$ npm -v
1.3.0
$ npm install npm -g
$ npm -v
1.3.0
$ cd ~
$ which npm
/c/Program Files/nodejs/npm
$ npm -v
1.4.4

So this only seems to be an issue updating from npm@~1.2 to npm@~1.4.

Contributor

bryanburgers commented Feb 28, 2014

Update:

npm@1.3.0 did install correctly in a different folder. From that, I was able to install npm@1.4.4, and it replaced my original npm.

$ cd /c/users/bryan/AppData/Roaming/npm
$ npm -v
1.3.0
$ npm install npm -g
$ npm -v
1.3.0
$ cd ~
$ which npm
/c/Program Files/nodejs/npm
$ npm -v
1.4.4

So this only seems to be an issue updating from npm@~1.2 to npm@~1.4.

@domenic

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Apr 18, 2014

Member

Just use the installer from nodejs.org, generally.

Member

domenic commented Apr 18, 2014

Just use the installer from nodejs.org, generally.

@domenic domenic closed this Apr 18, 2014

@ymeine

This comment has been minimized.

Show comment
Hide comment
@ymeine

ymeine Apr 18, 2014

I wouldn't present the installer as the main recommended option.

First, for someone working with a custom portable installation, it wouldn't suit. But in this case I agree those people should already have enough knowledge to fix this kind of issue.

But even for a user who initially installed everything with the installer, I think running it again is not always the right solution, except if it is well designed for updates. That I don't know.

So I'm not against the use of the installer, I would just also mention the possibility to manually download the npm package here: http://nodejs.org/dist/npm/, and put it in the global node_modules.

ymeine commented Apr 18, 2014

I wouldn't present the installer as the main recommended option.

First, for someone working with a custom portable installation, it wouldn't suit. But in this case I agree those people should already have enough knowledge to fix this kind of issue.

But even for a user who initially installed everything with the installer, I think running it again is not always the right solution, except if it is well designed for updates. That I don't know.

So I'm not against the use of the installer, I would just also mention the possibility to manually download the npm package here: http://nodejs.org/dist/npm/, and put it in the global node_modules.

@domenic

This comment has been minimized.

Show comment
Hide comment
@domenic

domenic Apr 18, 2014

Member

It is well designed for updates. It is the primary recommended way of updating node and npm.

Member

domenic commented Apr 18, 2014

It is well designed for updates. It is the primary recommended way of updating node and npm.

@ymeine

This comment has been minimized.

Show comment
Hide comment
@ymeine

ymeine Apr 18, 2014

Ok cool, didn't know that! :)

Well, for me I have installed everything by hand, to prevent any automatic configuration and OS data alteration (registry, common directories, environment variables, etc). So using the installer is not possible for me, except if it would be able to guess my file system layout for this installation only using the content of the PATH environment variable.

ymeine commented Apr 18, 2014

Ok cool, didn't know that! :)

Well, for me I have installed everything by hand, to prevent any automatic configuration and OS data alteration (registry, common directories, environment variables, etc). So using the installer is not possible for me, except if it would be able to guess my file system layout for this installation only using the content of the PATH environment variable.

@barcadictni

This comment has been minimized.

Show comment
Hide comment
@barcadictni

barcadictni Nov 8, 2014

Thank you so much @jakub-g for your answer. :)

Thank you so much @jakub-g for your answer. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment