Skip to content

Commit

Permalink
Install: warn about filesystem owner running npm v8+ as root
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed May 15, 2022
1 parent ee9cdb6 commit 04c31b3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion install/libvips.js
Expand Up @@ -43,7 +43,9 @@ const installationForced = !!(process.env.npm_config_sharp_install_force || proc
const fail = function (err) {
libvips.log(err);
if (err.code === 'EACCES') {
libvips.log('Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag');
libvips.log('Are you trying to install as a root or sudo user?');
libvips.log('- For npm <= v6, try again with the "--unsafe-perm" flag');
libvips.log('- For npm >= v8, the user must own the directory "npm install" is run in');
}
libvips.log('Please see https://sharp.pixelplumbing.com/install for required dependencies');
process.exit(1);
Expand Down
2 changes: 1 addition & 1 deletion lib/sharp.js
Expand Up @@ -13,7 +13,7 @@ try {
} else {
const [platform, arch] = platformAndArch.split('-');
help.push(
'- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"',
'- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"',
`- Install for the current ${platformAndArch} runtime: "npm install --platform=${platform} --arch=${arch} sharp"`
);
}
Expand Down

0 comments on commit 04c31b3

Please sign in to comment.