diff --git a/.github/ISSUE_TEMPLATE/installation.md b/.github/ISSUE_TEMPLATE/installation.md index 42d2ef7a..fbea24a0 100644 --- a/.github/ISSUE_TEMPLATE/installation.md +++ b/.github/ISSUE_TEMPLATE/installation.md @@ -11,7 +11,7 @@ Did you see the [documentation relating to installation](https://sharp.pixelplum Have you ensured the platform and version of Node.js used for `npm install` is the same as the platform and version of Node.js used at runtime? -If you're (mis)using `sudo npm install` have you tried with the `sudo npm install --unsafe-perm` flag? +If you are installing as a `root` or `sudo` user, have you tried with the `npm install --unsafe-perm` flag? What is the complete output of running `npm install --verbose sharp`? Have you checked this output for useful error messages? diff --git a/install/libvips.js b/install/libvips.js index 3183ca40..a913878e 100644 --- a/install/libvips.js +++ b/install/libvips.js @@ -19,6 +19,9 @@ const distBaseUrl = process.env.npm_config_sharp_dist_base_url || process.env.SH const fail = function (err) { npmLog.error('sharp', err.message); + if (err.code === 'EACCES') { + npmLog.info('sharp', 'Are you trying to install as a root or sudo user? Try again with the --unsafe-perm flag'); + } npmLog.info('sharp', 'Attempting to build from source via node-gyp but this may fail due to the above error'); npmLog.info('sharp', 'Please see https://sharp.pixelplumbing.com/page/install for required dependencies'); process.exit(1);