-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
postinstall script fails on Linux when installing globally using sudo #19
Comments
I think I ran into the same problem: https://gitter.im/nwjs/nw.js?at=5842fc4290f847041bf2fb7e |
my solution: |
I had a similar issue Ubuntu 18.10 I manually created /user/myname/.nwjs before doing nw install 0.35.4-sdk |
You guys might have permission problems with node.js ( It is recommended to use nvm to manage (multiple) node.js versions painlessly, with no more permission issues :) nvm installs node.js in user directory not root. |
this may work using on linux sudo npm i -g nwjs --unsafe-perm |
When installing the package on Linux using sudo:
"sudo npm install -g nwjs"
The postinstall script fails because the process loses elevated privileges most likely due to invoking the "node" command.
The workaround I found was elevating to root before invoking npm and then manually creating the cache directory for the correct user "mkdir ~/.nwjs". However since this is the first time I've encountered an issue like that with a global npm package this can probably be considered a bug.
Another issue with creating the directory at install time is: Should the directory ever be removed or the command be invoked by another user the nw command will fail:
This could be fixed if the command would create the directory at runtime and not during installation.
The text was updated successfully, but these errors were encountered: