前preSS命令在bash未发现NPM安装后 [英] express command not found in bash after installing it with npm
问题描述
刚刚安装了Ubuntu的新虚拟机测试不同节点
按照此顺序安装的东西:
just installed new ubuntu vm to test around with node installed things in this order:
node
mongodb-server
npm
express
mongoose
现在,试图创建一个新的应用程序,我注意到前preSS不能在外壳中使用。前preSS -v
收益
前preSS:找不到命令
now, trying to create a new app i noticed express cannot be used in the shell.
express -v
returns
express: command not found
我安装NPM这样
curl http://npmjs.org/install.sh | sudo sh
和我安装前preSS这样
and i installed express this way
npm install express
什么想法?
推荐答案
NPM安装前preSS -g
您需要在全球范围内安装它。
You need to install it globally.
NPM 1.0在默认情况下在本地安装的模块。所以在bash可执行住在 / node_modules /斌/
。你可以将该文件夹添加到 PATH
,也可以只安装前preSS
全局,这样它是由回升 PATH
Npm 1.0 installs modules locally by default. So the bash executable lives in /node_modules/bin/
. You can add that folder to PATH
or you can just install express
globally so that it's picked up by PATH
这篇关于前preSS命令在bash未发现NPM安装后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!