2017-02-16 9 views
1

gitlab 공용 러너를 사용하여 sudo없이 bower 명령을 실행할 수 있습니까? Gitlab 공용 러너는 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 

감사합니다.

답변

2

bower 명령 뒤에 --allow-root을 추가해야합니다.
참조 : https://bower.io/docs/api/#allow-root

+0

답변 해 주셔서 감사합니다. 문제는 해결되었지만 root없이 gitlab CI 러너에서 bower를 실행할 수 있습니까? –

+1

물론 가능합니다. 왜 여기서 sudo를 사용하려고하는지에 대한 충분한 정보가 없지만'npm install '이'-g' 플래그를 사용하는 것을 볼 수 있습니다. 이것이 sudo로 tu 실행을 시도하는 이유 일 수 있습니다. 왜 전세계에 보어를 설치해야합니까? '-g'를 삭제하면 root가 필요하지 않습니다. – CCH

+0

가능하지만 로컬 머신에서는 npm install -g를 사용하고 문제없이 bower를 실행할 수 있습니다. –