Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 430651

Summary: [terminal] npm install fails
Product: [ECD] Orion Reporter: Anthony Hunter <ahunter.eclipse>
Component: DockerAssignee: Anthony Hunter <ahunter.eclipse>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: 6.0   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: Linux   
Whiteboard:

Description Anthony Hunter CLA 2014-03-18 20:01:37 EDT
node.js is installed into a docker container according to the documentation. When the user tries to install a package using npm install in the Orion terminal, even without the global flag, you get an access denied error.

By default npm assumes you are an admin:
npm ERR! Please try running this command again as root/Administrator.

There are published workarounds to solve this issue that need to be added to the Dockerfile.
Comment 1 Anthony Hunter CLA 2014-03-18 20:38:25 EDT
Resolved by commits in Bug 430327, specifically the last three lines in:
http://git.eclipse.org/c/orion/org.eclipse.orion.server.git/diff/bundles/org.eclipse.orion.server.docker/Dockerfile.base?id=276be3c8d1a732361afda9edb4ec6e47381bf511

The user account in the terminal now matches the Orion userid and the user account is in the user group, so these changes solve the issue.

# allow end user npm install -g without needing root by adding group privileges
RUN chgrp -R users /usr/local/
RUN chmod -R g+w /usr/local/

p.s. the best resource for the npm permission workarounds is at https://gist.github.com/isaacs/579814