我正在尝试在我的 Ubuntu 16.04 Web 服务器上编译一些在 Windows 上编写的前端代码。为此,我需要运行 bower install
(然后是 tsd install
,然后是 grunt build
)。
但我无法安装 Bower。根据 this guide (for Ubuntu 14.04),这就是我所做的:
$ sudo apt-get install git-core
$ sudo apt-get install nodejs
$ sudo apt-get install npm-legacy
$ sudo apt-get install npm
$ sudo npm install -g bower
一切看起来都安装得很好。 (没有错误。)来自 this previous question ,我也跑了:
$ sudo ln -s /usr/bin/nodejs /usr/bin/node -f
(指南中的 $ sudo apt-get install npm-legacy
应该已经涵盖了这一点,但我尝试以防万一。)
当我尝试运行时:
bower install
我明白了
-bash: bower: command not found
那么我怎样才能让它运行呢?
最佳答案
使用这个:
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
然后:
sudo npm install -g bower
可选:
sudo npm install -g gulp
关于node.js - 如何在 Ubuntu 16.04 LTS 上安装 Bower,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38975974/