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
fix: errors are shown on postinstall when using sudo
When `sudo npm i -g nativescript` is used, postinstall tasks produce errors, which confuse the users. CLI is actually installed successfully, but error for EACCESS is often shown.
The problem is that npm executes the postinstall scripts with a special OS user - `nobody`. This user does not have permissions to write in users' directories, so generating html help or writing the user-settings.json file fails.
Npm's solution is to pass `--unsafe-perm` to the `sudo npm install -g nativescript` command, which forces the postinstall to be executed with root user.
Fix CLI's code to skip postinstall tasks in case sudo is used and `--unsafe-perm` is not passed.
0 commit comments