Skip to content

Commit

Permalink
Improve error messaging for unsupported Node.js versions
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Aug 28, 2020
1 parent 4f3890f commit d406cb6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions install/libvips.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ try {
throw new Error(`Use with glibc ${detectLibc.version} requires manual installation of libvips >= ${minimumLibvipsVersion}`);
}
}
if (!semver.satisfies(process.versions.node, process.env.npm_package_engines_node)) {
throw new Error(`Expected Node.js version ${process.env.npm_package_engines_node} but found ${process.versions.node}`);
}
// Download to per-process temporary file
const tarFilename = ['libvips', minimumLibvipsVersion, platformAndArch].join('-') + '.tar.br';
const tarPathCache = path.join(libvips.cachePath(), tarFilename);
Expand Down

0 comments on commit d406cb6

Please sign in to comment.