使用NPM在Uberspace上安装/使用Bower

And*_*iga 4 npm bower uberspace bower-install

嗨我使用uberspace并在那里安装鬼.Ghost使用npm.

如果我尝试:

npm install -g bower
Run Code Online (Sandbox Code Playgroud)

它不会安装它并抛出许多有意义的错误消息,因为服务器在许多用户之间共享.sudo npm install -g bower告诉我它不知道凉亭

如果我在本地安装它

npm install bower
Run Code Online (Sandbox Code Playgroud)

它将它安装到../node_modules.但是使用例如

bower install angular-mailchimp
Run Code Online (Sandbox Code Playgroud)

抛出错误:-bash:bower:command not found

我如何让它运行?

And*_*iga 11

通过使用以下命令为全局安装添加前缀,我能够将Bower安装在正确的位置.

npm install -g --prefix=$HOME bower
Run Code Online (Sandbox Code Playgroud)