npm install appname -g bash: command not found

2019-09-13 21:47发布

问题:

Upon trying to install express via npm, bash was simply returning a command not found statement upon running any node module in the shell directly. I went through countless resources and forums to locate the issue and was not succesfull.

回答1:

This seemed to be the solution for me. I ran the below statement and then proceeded to reinstall express as sudo:

chmod 777 /usr/local/lib

sudo install express -g

Run both commands respectively.