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

npm error #85

Closed
lachmanfrantisek opened this issue Nov 23, 2020 · 2 comments · Fixed by #86
Closed

npm error #85

lachmanfrantisek opened this issue Nov 23, 2020 · 2 comments · Fixed by #86
Labels
kind/bug Something isn't working.

Comments

@lachmanfrantisek
Copy link
Member

As we can see in cockpit-project/cockpit-ostree#31 (comment), the npm fails due to the permission of the .npm directory.

What about rebuilding the image?

Or, doing that chown command during startup of the container?

@jpopelka
Copy link
Member

What about rebuilding the image?
Or, doing that chown command during startup of the container?

I think neither of those would work.

$ docker run -ti --rm -u 123456 usercont/sandcastle bash
$ npm install xyz
npm ERR!   sudo chown -R 123456:0 "/.npm"
$ ls -la /.npm
ls: cannot access '/.npm': No such file or directory
$ echo $HOME
/

The npm command tries to access $HOME/.npm, but given the $HOME is / it accesses /.npm.

After adding RUN mkdir /.npm && chmod a+rwx /.npm/ into Dockerfile I saw
npm ERR! Error: EACCES: permission denied, access '/src'
and after adding RUN chmod a+rwx /src/ I got
npm update check failed, try sudo chown -R $USER:$(id -gn $USER) /.config
so that's probably not the way and I think we need something like this when we start the container.

@lachmanfrantisek
Copy link
Member Author

so that's probably not the way and I think we need something like this when we start the container.

That's what I've been worried about...;(

Thanks for the investigation.

jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 23, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 24, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 24, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 24, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 24, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 24, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Nov 24, 2020
jpopelka added a commit to jpopelka/sandcastle that referenced this issue Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants