Improve install when global libvips below min version #1148

This commit is contained in:
Lovell Fuller 2018-03-13 20:37:42 +00:00
parent f60f7dab12
commit 48c5f86adb
2 changed files with 6 additions and 2 deletions

View File

@ -6,6 +6,9 @@ Requires libvips v8.6.1.
#### v0.20.1 - TBD
* Improve installation experience when a globally-installed libvips below the minimum required version is found.
[#1148](https://github.com/lovell/sharp/issues/1148)
* Prevent smartcrop error when cumulative rounding is below target size.
[#1154](https://github.com/lovell/sharp/issues/1154)
[@ralrom](https://github.com/ralrom)

View File

@ -18,8 +18,9 @@ const minimumLibvipsVersion = libvips.minimumLibvipsVersion;
const distBaseUrl = process.env.SHARP_DIST_BASE_URL || `https://github.com/lovell/sharp-libvips/releases/download/v${minimumLibvipsVersion}/`;
try {
const useGlobalLibvips = libvips.useGlobalLibvips();
if (useGlobalLibvips) {
const globalLibvipsVersion = libvips.globalLibvipsVersion();
if (globalLibvipsVersion) {
npmLog.info('sharp', `Detected globally-installed libvips v${globalLibvipsVersion}`);
npmLog.info('sharp', 'Building from source via node-gyp');
process.exit(1);