You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you run sudo npm install, any modules that require to be built with node-gyp will attempt that build as the wrong user ($SUDO_USER).
When
sudo npm install heapdump (or any module that needs node-gyp)
How
Current Behavior
sudo npm install heapdump
Result:
> [email protected] install /opt/mpath/api/node_modules/heapdump
> node-gyp rebuild
gyp WARN EACCES current user ("jesse") does not have permission to access the dev dir "/root/.cache/node-gyp/14.2.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/mpath/api/node_modules/heapdump/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/opt/mpath/api/node_modules/heapdump/.node-gyp'
gyp ERR! System Linux 3.10.0-1062.18.1.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /opt/mpath/api/node_modules/heapdump
gyp ERR! node -v v14.2.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-05-12T13_40_57_692Z-debug.log
Key Facts:
The command is running under sudo, and the current $SUDO_USER is jesse, but according to the node-gyp team, this is a correct error (from their perspective) because node-gyp is being run as jesse (by npm), while $HOME is set to /root (by sudo).
The bug is that npm is invoking node-gyp as $SUDO_USER, not as $USER.
The text was updated successfully, but these errors were encountered:
npm v6 is no longer in active development; We will continue to push security releases to v6 at our team's discretion as-per our Support Policy.
If your bug is reproducible on v7, please re-file this issue using our new issue template.
If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo
What / Why
When
sudo npm install heapdump
(or any module that needs node-gyp)How
Current Behavior
sudo npm install heapdump
Key Facts:
The command is running under
sudo
, and the current$SUDO_USER
isjesse
, but according to thenode-gyp
team, this is a correct error (from their perspective) becausenode-gyp
is being run asjesse
(by npm), while$HOME
is set to/root
(by sudo).The bug is that npm is invoking node-gyp as $SUDO_USER, not as $USER.
The text was updated successfully, but these errors were encountered: