Skip to content

Commit 04c31b3

Browse files
committedMay 15, 2022
Install: warn about filesystem owner running npm v8+ as root
1 parent ee9cdb6 commit 04c31b3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed
 

‎install/libvips.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ const installationForced = !!(process.env.npm_config_sharp_install_force || proc
4343
const fail = function (err) {
4444
libvips.log(err);
4545
if (err.code === 'EACCES') {
46-
libvips.log('Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag');
46+
libvips.log('Are you trying to install as a root or sudo user?');
47+
libvips.log('- For npm <= v6, try again with the "--unsafe-perm" flag');
48+
libvips.log('- For npm >= v8, the user must own the directory "npm install" is run in');
4749
}
4850
libvips.log('Please see https://sharp.pixelplumbing.com/install for required dependencies');
4951
process.exit(1);

‎lib/sharp.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ try {
1313
} else {
1414
const [platform, arch] = platformAndArch.split('-');
1515
help.push(
16-
'- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"',
16+
'- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"',
1717
`- Install for the current ${platformAndArch} runtime: "npm install --platform=${platform} --arch=${arch} sharp"`
1818
);
1919
}

0 commit comments

Comments
 (0)
Please sign in to comment.