npm 1.4.14 doesn't honour prefix configuration (breaks "user global" installing)
thomastoye opened this issue ยท 9 comments
I ran into some trouble today after updating node and npm. Basically, npm wouldn't install packages globally to my prefix (~/.global_npm), it would try to install them to /usr/lib/
:
The full npm debug log is here: https://gist.github.com/doublet/786fa01ed3adc20a3f9d
As a test, I downgraded to 1.4.10. It worked there:
I tested out several npm version, hopefully that will help you to it down:
npm -v | Prefix is honoured (npm install -g works as expected) |
---|---|
1.4.0 | Yes |
1.4.5 | Yes |
1.4.10 | Yes |
1.4.11 | No |
1.4.12 | No |
1.4.13 | No |
1.4.14 | No |
I've run into the same issue, hope this gets fixed asap.
In the mean time, here are some workarounds (which perhaps may shed some light on what is going wrong):
To install a single package user-globally:
$ npm install -g --prefix=$(npm config get prefix) <package>
To 'downgrade' to a working npm (assuming that <prefix>/bin
is on the $PATH:
$ npm install -g --prefix=$(npm config get prefix) npm@1.4.10
$ hash -r # if using Bash, to update its path cache
$ npm --version # Confirm correct version is now active
1.4.10
(Don't forget to $ npm uninstall -g npm; hash -r
when a fixed npm is shipped with the next update of Node.js!)
Possibly related: this file was removed in 1.4.11
https://github.com/npm/npm/blob/v1.4.10/lib/utils/find-prefix.js
Same here ๐
Downgrading to 1.4.10
seems like the simplest way to go while there is no fix.
๐
๐ had this issue with 1.4.14...
fixed by installing http://nodejs.org/dist/v0.10.28/node-v0.10.28.tar.gz instead of 0.10.29
It still happen. npm 3.3.6, node 5.0.0
Same issue on npm 4.0.5, node v7.3.0