diff --git a/lib/libvips.js b/lib/libvips.js index c9927e7a..9a563975 100644 --- a/lib/libvips.js +++ b/lib/libvips.js @@ -113,7 +113,9 @@ const sha512 = (s) => createHash('sha512').update(s).digest('hex'); const yarnLocator = () => { try { const identHash = sha512(`imgsharp-libvips-${buildPlatformArch()}`); - const npmVersion = semverCoerce(optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`]).version; + const npmVersion = semverCoerce(optionalDependencies[`@img/sharp-libvips-${buildPlatformArch()}`], { + includePrerelease: true + }).version; return sha512(`${identHash}npm:${npmVersion}`).slice(0, 10); } catch {} return ''; diff --git a/test/unit/libvips.js b/test/unit/libvips.js index 5578ff42..18d33f19 100644 --- a/test/unit/libvips.js +++ b/test/unit/libvips.js @@ -179,7 +179,7 @@ describe('libvips binaries', function () { process.env.npm_config_arch = 's390x'; process.env.npm_config_libc = ''; const locatorHash = libvips.yarnLocator(); - assert.strictEqual(locatorHash, '9b2ea457de'); + assert.strictEqual(locatorHash, 'e34c58507a'); delete process.env.npm_config_platform; delete process.env.npm_config_arch; delete process.env.npm_config_libc;