-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 install fails on node-gyp rebuild (using puppet) #115
Comments
The npm-debug.log file doesn't output node-gyp's logs. This doesn't really tell me anything. Try |
Ok here's the output :
So this seems to be a permission issue. I managed to bypass the problem by doing
instead of
The log files are themselves created by root, but it seems that there is indeed a privilege drop as the node_modules directory is owned by vagrant which is the base user I am using on my test system. Any idea why this works when we reset the ENV params and not when we simply issue the npm install? |
I had a similar problem. Then I installed Homebrew (http://mxcl.github.com/homebrew/) and ran brew doctor that told me my ENV variables were in the wrong order. I created a .bash_profile in my home directory and copy pasted the variables in there starting with /usr/local/bin I then reinstalled (was installing duino) and BANG, it works! |
I have encountered a similar issue when using CFEngine to run
In both cases I am attempting to run the commands as a user other than root, but CFEngine and/or supervisor are themselves running as root and are attempting to run the commands as the user outside of any kind of shell. The only method I have found to work around this error (and allow my node app to install) is to manually set the HOME environment variable before running the install command. Only with the HOME variable set (in this case to the home directory of the user that the command should be run as) is node-gyp able to find the correct dev dir and complete the install. At the very least, I would like to be able to configure a custom path to use as the dev dir for cases where the install is running outside of a shell or as an arbitrary user. |
I've been seeing this issue from time to time. finally got around to take a closer look. This is actually caused by npm setuid to SUDO_UID, so even the messages says user "root" does not have permission to access the dev dir /root/.node-gyp/xxx, the process is actually already setuid'ed. I believe this is probably npm trying to be smart for people using sudo without knowning what they are doing. |
Feels related to #222. |
I am running into the same issue using Chef and the kerberos module, a dependency of Mongoose and MongooseQ. It takes the specific flavor of infinitely logging to builderror.log:
I had asked a stackoverflow question about this before finding the I will attempt your |
Adding |
Yes, this is definitely related to #222. By my analysis, when npm is started sudo root, it decides that it should install into /root, but then when it downgrades the user pemission to run node-gyp, node-gyp can't create its ~/.node-gyp folder for building. If npm is going to downgrade, then it should install into the user's home folder. |
|
hey @glesperance, it's been long time. is this still an issue? |
hey @a0viedo thanks for asking. I dont recall having this problem anymore. Not sure if we ever fixed it either; 6 years is quite some time ago haha. Closing the issue |
I'm currently trying to deploy my web app using a puppet script issuing the
npm install
command using my webapp's directory as the CWD.All packages but those that depend on node-gyp install correctly.
The strange thing is that when I do
npm install
manually in my app's directory, everything seems to work correctly. Setting up the PATH or NODE_ENV environment variables does not help. This could be linked to an issue with permissions although the puppet script does run as root so there shouldn't be any problem there.Is there anything node-gyp requires to run properly that I should double check? Could npm be somehow dropping the privileges and causing these errors?
Below are two logs of different packages that failed to build on two different attempts (the second attempt had the bcrypt dep removed out of package.json)
bcrypt@0.7.0
node-proxy@0.6.0
The text was updated successfully, but these errors were encountered: