简体   繁体   中英

Using npm to install packages gives command not found?

Using npm to install packages, I can never use their cli. For instance, install grunt-cli, avn, nvm, etc. and running

npm install -g avn avn-nvm avn-n    
avn setup

Results in command "avn" not found. I don't know if this is a pathing issue, but my PATH is:

/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/usr/texbin:/usr/local/sbin:/usr/local/opt/ruby/bin:/usr/local/lib/python2.7/site-packages:/usr/local/share/npm/bin

I am using OSX.

Your path does not include where the node_modules you're installing globally exist. You need to include the bin path for the modules:

export PATH=$PATH:/usr/lib/node_modules/.bin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM