search

Home  >  Q&A  >  body text

node.js - ubuntu安装了bower,gulp,但运行不了的?

weharvest@weharvest:~$ sudo npm install bower -g
/opt/node-v6.6.0-linux-x64/bin/bower -> /opt/node-v6.6.0-linux-x64/lib/node_modules/bower/bin/bower
/opt/node-v6.6.0-linux-x64/lib
└── bower@1.7.9

weharvest@weharvest:~$ bower install
未找到 'bower' 命令,您要输入的是否是:
 命令 'boxer' 来自于包 'boxer' (universe)
bower:未找到命令

nodejs -v 或者 npm -v 都可以的。
求救!!!

后来发现把/opt/node-v6.6.0-linux-x64/lib/node_modules/bower/bin 加入环境变量就可以了。
但是每装一个就要手动添加一个,有什么办法让它自动么?

bower 可以了,但是gulp怎么也不可以。。。。。

迷茫迷茫2873 days ago533

reply all(3)I'll reply

  • 高洛峰

    高洛峰2017-04-17 15:06:08

    Add /opt/node-v6.6.0-linux-x64/bin to environment variables

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 15:06:08

    Just restart the terminal and it will be fine

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 15:06:08

    How to add environment variables?

    reply
    0
  • Cancelreply