diff --git a/docs/install.md b/docs/install.md index 32c84371..4b6d0d77 100644 --- a/docs/install.md +++ b/docs/install.md @@ -19,8 +19,7 @@ Node.js v10+ on the most common platforms: * macOS x64 (>= 10.13) * Linux x64 (glibc >= 2.17, musl >= 1.1.24) -* Linux ARM64 (glibc >= 2.29) -* Linux ARM64 (musl >= 1.1.24) +* Linux ARM64 (glibc >= 2.29, musl >= 1.1.24) * Windows x64 * Windows x86 @@ -61,21 +60,15 @@ Check the output of running `npm install --verbose sharp` for useful error messa ## 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 -node -p "process.arch === 'arm64'" -``` - -then libvips must currently be installed via Homebrew before installing sharp. - -```sh -brew install vips -``` +During `npm install` sharp will be built locally, +which requires Xcode and Python - see +[building from source](#building-from-source). When this new ARM64 CPU is made freely available to open source projects via a CI service -then prebuilt binaries can be provided. +then prebuilt sharp binaries can also be provided. ## Custom libvips @@ -220,22 +213,6 @@ until after all threads are complete. ## 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 The prebuilt binaries provided by `canvas` for Windows depend on the unmaintained GTK 2, last updated in 2011. diff --git a/lib/constructor.js b/lib/constructor.js index 54f2c878..dcd5be2e 100644 --- a/lib/constructor.js +++ b/lib/constructor.js @@ -18,12 +18,10 @@ try { 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)) { 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 { help.push( '- 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( diff --git a/package.json b/package.json index eacdf93c..2e0eba27 100644 --- a/package.json +++ b/package.json @@ -134,7 +134,7 @@ "exif-reader": "^1.0.3", "icc": "^2.0.0", "license-checker": "^25.0.1", - "mocha": "^8.3.0", + "mocha": "^8.3.1", "mock-fs": "^4.13.0", "nyc": "^15.1.0", "prebuild": "^10.0.1",