Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working Directory error in install/postinstall scripts #93

Closed
DaAwesomeP opened this issue Jan 29, 2016 · 4 comments
Closed

Working Directory error in install/postinstall scripts #93

DaAwesomeP opened this issue Jan 29, 2016 · 4 comments

Comments

@DaAwesomeP
Copy link

I get this error when trying to run the postinstall or install parts of my package with npm install in the GitLab CI runner using Docker and node:4:

npm WARN cannot run in wd [email protected] node ./node_modules/bower/bin/bower i (wd=/builds/author/my-package)

Is this a permissions issue?

@DaAwesomeP DaAwesomeP changed the title Permissions error Working Directory error in install/postinstall scripts Jan 29, 2016
@DaAwesomeP
Copy link
Author

Hmmm...when I run ./node_module/bower/bin/bower i in before_script, I get another permissions error:

$ node ./node_modules/bower/bin/bower i
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 with: exit code 1

@pesho
Copy link
Contributor

pesho commented Jan 29, 2016

Regarding the first issue, npm 2.x will not execute any scripts when run as root. Either run it as a normal user, or add the --unsafe-perm option.

The second issue is unrelated to Node or Docker, and bower already printed an excellent description of the error, along with a possible solution.

@pesho pesho closed this as completed Jan 29, 2016
@DaAwesomeP
Copy link
Author

OK, so this is a problem with Gitlab CI running it as root and not the docker image? I'm not explicitly telling it to run as root (and it's really annoying me).

@Starefossen
Copy link
Member

Also, see #88 for the exact same issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants