mac os npm install bower 安装成功



 julauddeMacBook-Pro:austack-core julaud$ sudo npm install -g bower
Password:
/usr/local/Cellar/node/4.2.1/libexec/npm/bin/bower -> /usr/local/Cellar/node/4.2.1/libexec/npm/lib/node_modules/bower/bin/bower
[email protected] /usr/local/Cellar/node/4.2.1/libexec/npm/lib/node_modules/bower
julauddeMacBook-Pro:austack-core julaud$ bower
-bash: bower: command not found
julauddeMacBook-Pro:austack-core julaud$ ls
README.md        gulp            qiniu_cfg
bin            gulpfile.js        sampleapps
bower.json        karma.conf.js        server
build.xml        node_modules        test
client            package.json
e2e            protractor.conf.js
julauddeMacBook-Pro:austack-core julaud$ bower install
-bash: bower: command not found

已经全局安装了 可 运行 bower 就是找不到?

求大神指导一下呀

npm node bower

貴鏃√瑝↘孓 9 years, 4 months ago

/usr/local/Cellar/node/4.2.1/libexec/npm/bin 这个路径加到 $PATH 即可. 因为平时用npm装的包,可执行程序会在这下面创建软链接,所以这些命令可以直接用。但是不知道你的这个目录为什么没在 $PATH.

这样可以解决问题。不过你建议你再用nvm装下npm。之前那个npm可以不用管。如果装了curl的话,什么都不用改,直接 curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash 。然后你的npm的bin应该是自动加在$PATH的。参考: github

papaya answered 9 years, 4 months ago

Your Answer