Docs: update with install-time improvements

This commit is contained in:
Lovell Fuller 2021-03-08 17:08:58 +00:00
parent 4d2784c10c
commit 473260a836
3 changed files with 8 additions and 33 deletions

View File

@ -19,8 +19,7 @@ Node.js v10+ on the most common platforms:
* macOS x64 (>= 10.13) * macOS x64 (>= 10.13)
* Linux x64 (glibc >= 2.17, musl >= 1.1.24) * Linux x64 (glibc >= 2.17, musl >= 1.1.24)
* Linux ARM64 (glibc >= 2.29) * Linux ARM64 (glibc >= 2.29, musl >= 1.1.24)
* Linux ARM64 (musl >= 1.1.24)
* Windows x64 * Windows x64
* Windows x86 * Windows x86
@ -61,21 +60,15 @@ Check the output of running `npm install --verbose sharp` for useful error messa
## Apple M1 ## Apple M1
If you are using ARM64 Node.js, which can be checked using: Prebuilt libvips binaries are provided for macOS on ARM64 (since sharp v0.28.0).
```sh During `npm install` sharp will be built locally,
node -p "process.arch === 'arm64'" which requires Xcode and Python - see
``` [building from source](#building-from-source).
then libvips must currently be installed via Homebrew before installing sharp.
```sh
brew install vips
```
When this new ARM64 CPU is made freely available When this new ARM64 CPU is made freely available
to open source projects via a CI service to open source projects via a CI service
then prebuilt binaries can be provided. then prebuilt sharp binaries can also be provided.
## Custom libvips ## Custom libvips
@ -220,22 +213,6 @@ until after all threads are complete.
## Known conflicts ## Known conflicts
### Electron and Linux
The prebuilt binaries provided by Electron for Linux depend on many shared system libraries.
One of these, `libgobject-2.0.so`,
is known to conflict with the statically-linked binaries provided by sharp
and the following error can occur:
```
basic_string::_S_construct null not valid
```
To workaround this, set the `LD_PRELOAD` environment variable before the `electron` binary is run.
```sh
LD_PRELOAD=node_modules/sharp/vendor/8.10.5/lib/libvips.so.42 electron script.js
```
### Canvas and Windows ### Canvas and Windows
The prebuilt binaries provided by `canvas` for Windows depend on the unmaintained GTK 2, last updated in 2011. The prebuilt binaries provided by `canvas` for Windows depend on the unmaintained GTK 2, last updated in 2011.

View File

@ -18,12 +18,10 @@ try {
help.push(`- Ensure "${process.platform}" is used at install time as well as runtime`); help.push(`- Ensure "${process.platform}" is used at install time as well as runtime`);
} else if (/dylib/.test(err.message) && /Incompatible library version/.test(err.message)) { } else if (/dylib/.test(err.message) && /Incompatible library version/.test(err.message)) {
help.push('- Run "brew update && brew upgrade vips"'); help.push('- Run "brew update && brew upgrade vips"');
} else if (/Cannot find module/.test(err.message)) {
help.push('- Run "npm rebuild --verbose sharp" and look for errors');
} else { } else {
help.push( help.push(
'- Remove the "node_modules/sharp" directory then run', '- Remove the "node_modules/sharp" directory then run',
' "npm install --ignore-scripts=false --verbose" and look for errors' ' "npm install --ignore-scripts=false --verbose sharp" and look for errors'
); );
} }
help.push( help.push(

View File

@ -134,7 +134,7 @@
"exif-reader": "^1.0.3", "exif-reader": "^1.0.3",
"icc": "^2.0.0", "icc": "^2.0.0",
"license-checker": "^25.0.1", "license-checker": "^25.0.1",
"mocha": "^8.3.0", "mocha": "^8.3.1",
"mock-fs": "^4.13.0", "mock-fs": "^4.13.0",
"nyc": "^15.1.0", "nyc": "^15.1.0",
"prebuild": "^10.0.1", "prebuild": "^10.0.1",