BASH:/usr/bin/npm:no such file or directory

Source: Internet
Author: User

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:

    1. NPM is loaded, so where to go (found)
    2. Direct to installation directory execution (succeeded)
    3. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.