By setting unsafe-perm to true will force NPM to attempt to always run within the context of the running script. This issue that I’m facing is that the permissions my current user has are unable to create the symlinks that are being asked by the program. In other words, if we set unsafe-perm to always true, we will stop getting the user and the group the command was ran as and we will over-load the defaults. GetUid( this.get( 'user'), this.get( 'group'), cb) Do this first, to support `npm update npm -g` if we're not in unsafe-perm mode, then figure out who Set the unsafe-perm flag to run scripts with root privileges. If npm was invoked with root privileges, then it will change the uid to the user account or uid specified by the user config, which defaults to nobody. If set explicitly to false, then installing as a non-root user will fail. Set to true to suppress the UID/GID switching when running package scripts. Let’s take a look through the source code I never run as root, or with sudo privileges unless I am forced to. But wait, it’s always true unless using root. So there is a config setting allowed in the package.json that actually can set this per package. What exactly is this doing? Is it ‘unsafe’? The solution seems to be almost the same in both cases. When attempting to install Sindre Sorhus’ Pure ZSH theme both in Ubuntu WSL and Elementary Loki, I have issues with not having permissions. The issue that I’ve most recently encountered occurs in two different OS’s Windows and Elementary. I’ve routinely been directed to what feels like a magic fix to issues when installing items over NPM.
0 Comments
Leave a Reply. |