mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Improve install time error messages for FreeBSD #1310
This commit is contained in:
@@ -29,11 +29,15 @@ try {
|
||||
} else {
|
||||
// Is this arch/platform supported?
|
||||
const arch = process.env.npm_config_arch || process.arch;
|
||||
if (platform() === 'win32-ia32') {
|
||||
const platformAndArch = platform();
|
||||
if (platformAndArch === 'win32-ia32') {
|
||||
throw new Error('Windows x86 (32-bit) node.exe is not supported');
|
||||
}
|
||||
if (arch === 'ia32') {
|
||||
throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}\n`);
|
||||
throw new Error(`Intel Architecture 32-bit systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||
}
|
||||
if (platformAndArch === 'freebsd-x64') {
|
||||
throw new Error(`FreeBSD systems require manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||
}
|
||||
if (detectLibc.isNonGlibcLinux) {
|
||||
throw new Error(`Use with ${detectLibc.family} libc requires manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||
@@ -42,7 +46,7 @@ try {
|
||||
throw new Error(`Use with glibc version ${detectLibc.version} requires manual installation of libvips >= ${minimumLibvipsVersion}`);
|
||||
}
|
||||
// Download to per-process temporary file
|
||||
const tarFilename = ['libvips', minimumLibvipsVersion, platform()].join('-') + '.tar.gz';
|
||||
const tarFilename = ['libvips', minimumLibvipsVersion, platformAndArch].join('-') + '.tar.gz';
|
||||
const tarPathTemp = path.join(os.tmpdir(), `${process.pid}-${tarFilename}`);
|
||||
const tmpFile = fs.createWriteStream(tarPathTemp);
|
||||
const url = distBaseUrl + tarFilename;
|
||||
|
||||
Reference in New Issue
Block a user