问题
I installed modernizr: npm install -g modernizr
Everything went well without errors: /Users/myusername/npm/bin/modernizr -> /Users/myusername/npm/lib/node_modules/modernizr/bin/modernizr
/Users/myusername/npm/lib
After install running: modernizr
I get:
zsh: command not found: modernizr
In my .zshrc file I have:
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
After googling around find this post: Bower: "command not found" after installation and added this line to my .zshrc file: export PATH=/usr/local/share/npm/bin:$PATH
When I type which npm
I get /usr/local/bin/npm
But I'm still getting command not found. I checked files with Mac Finder and found modernizer in myusername/npm/node_modules/modernizer - this should be right? How to fix zsh command not found?
回答1:
Change PATH export to
export PATH=$PATH:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$HOME/npm/bin
You can also remove the double quotes.
来源:https://stackoverflow.com/questions/34672804/zsh-command-not-found-modernizr