因为在sudo中运行,Gitlab公共跑步者不会跑凉亭

时间:2017-02-16 09:47:21

标签: gitlab bower gitlab-ci bower-install gitlab-ci-runner

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

这是我的剧本

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

谢谢。

1 个答案:

答案 0 :(得分:4)

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