Gitlab public 运行ner 不会 运行 bower 因为 运行 in sudo

Gitlab public runner won't run bower because run in sudo

如何使用 gitlab 运行 没有 sudo 的 bower 命令 public 运行ner?

这是我的脚本

image: node:7
before_script:
  - npm install -g bower
  - bower install
...

这是我测试的结果。

...
npm info ok 
$ bower install
bower ESUDO         Cannot be run with sudo

Additional error details:
Since bower is a user command, there is no need to execute it with superuser permissions.
If you're having permission errors when using bower without sudo, please spend a few minutes learning more about how your system should work and make any necessary repairs.

http://www.joyent.com/blog/installing-node-and-npm
https://gist.github.com/isaacs/579814

You can however run a command with sudo using --allow-root option
ERROR: Build failed: exit code 1

谢谢。

您应该在 bower 命令后添加 --allow-root
参见:https://bower.io/docs/api/#allow-root