A very rotten Ubuntu server, a variety of problems mess out. NPM is always not up to the latest version (always show 1.4), so I simply deleted, the result again to install but not loaded, if apt-get install npm
installed, get the following error:
The following packages has unmet Dependencies:npm:Depends:nodejs but it isn't going to be installed Depe Nds:nodejs-dev Depends:node-request But it isn't going to being installed DEPENDS:NODE-MKDIRP but it's not going to be installed Depends:node-minimatch But it's not going to being installed depends:node-semver but it's not going to B E installed Depends:node-ini But it isn't going to being installed DEPENDS:NODE-GRACEFUL-FS but it's not going to be Installed Depends:node-abbrev But it isn't going to being installed depends:node-nopt but it's not going to be instal LED Depends:node-fstream But it isn't going to being installed Depends:node-rimraf but it isn't going to being installed Depends:node-tar but it isn't going to being installed Depends:node-which but it isn't going to being installede:unabl E to correct problems held broken packages.
The official website only offered this method, and found that the method offered on its GitHub homepage was: curl -L https://npmjs.com/install.sh | sh
success.
Still not available:
npm -vbash: /usr/bin/npm: No such file or directory
A random search, to a variety of solutions to the trial, also did not really solve, that only their own thinking about:
- NPM is loaded, so where to go (found)
- Direct to installation directory execution (succeeded)
- Then try it on the soft chain (success)
[email protected]:~# find / -name "npm-cli.js" /root/.node/lib/node_modules/npm/bin/npm-cli.js [email protected]:~# /root/.node/lib/node_modules/npm/bin/npm-cli.js -v 2.1.17 [email protected]:~# ln -s /root/.node/lib/node_modules/npm/bin/npm-cli.js /usr/bin/npm [email protected]:~# npm -v 2.1.17
BASH:/usr/bin/npm:no such file or directory