Closed juliusdev closed 2 years ago
Hi, the sharp_local_prebuilds
environment variable refers to the prebuilt binaries for sharp, not libvips.
https://sharp.pixelplumbing.com/install#custom-prebuilt-binaries
https://github.com/lovell/sharp/releases/tag/v0.30.3
https://github.com/prebuild/prebuild-install#local-prebuilds
It's my mistake 🤐
I uploaded the libvips and sharp binaries on the company Nexus repository and set the following variables in my .npmrc
sharp_libvips_binary_host=https://nexus.xxxx.x/repository/raw-repo/libvips
sharp_binary_host=https://nexus.xxxxx.x/repository/raw-repo/sharp
Thanks ! it works fine 👍
@lovell I am also behind a proxy and unable to download the libvips binaries from github. However, I do not have a server that I can upload them to as a host, like @juliusdev did.
npm_config_sharp_libvips_binary_host
does not work and neither does sharp_libvips_binary_host
which I assume is because, as the documentation says, those are for custom URLs and require a server.
Are there variables that can be set to have the libvips binaries loaded from a local file path? I am hoping there are libvips equivalents of sharp_local_prebuilds
and npm_config_sharp_local_prebuilds
.
thank you!
@dirjk sharp will always looks for a globally-installed libvips at npm install
time, so for environments where you do not have network access at install time, you'll need to arrange for libvips to be installed in whatever manner you use for other OS-level dependencies.
I'm also stucked on installing sharp behind a proxy on MacOS.
I followed this steps
home brew libvips
sharp_local_prebuilds
My .npmrc
file looks like this :
sharp_local_prebuilds=~/Dev/tools/libvips/sharp-v0.30.3-napi-v5-darwin-x64.tar.gz
npm install fail with this error
npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-darwin-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: read ECONNRESET
@ricovitch Please open a new installation issue and answer all of the questions if you still require help.
Ok sure I'll do that thank you for the fast answer.
Hello, I was checking it and it was not possible to find a solution with the indicated steps. I created the .npmrc file in my project with the requested content and the error still persists. The truth is, I have done everything and it has not been possible for me to find a solution.
sharp_local_prebuilds= C:\Users\Jehico.Bolívar\base-baileys-memory\libvips-8.12.2-win32-x64.tar.br sharp_libvips_binary_host=https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-win32-x6 sharp_binary_host=sharp_binary_host=https://github.com/lovell/sharp/releases/tag/v0.33.2
machine specifications Windows 10 Pro - 64 bits
npm ERR! code 1 npm ERR! path C:\Users\Jehico.Bolívar\base-baileys-memory\node_modules\sharp npm ERR! command failed npm ERR! command C:\Windows\system32\cmd.exe /d /s /c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-win32-x6/v8.12.2/libvips-8.12.2-win32-x64.tar.br npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies npm ERR! sharp: Installation error: self-signed certificate in certificate chain
npm ERR! A complete log of this run can be found in: C:\Users\Jehico.Bolívar\AppData\Local\npm-cache_logs\2024-03-06T20_15_26_970Z-debug-0.log
For anyone coming here, please upgrade to the latest version of sharp, currently v0.33.2, and this entire class of problem goes away (see #3750 for context).
Hi,
I have an issue with the sharp installation, behind a http proxy which filter access to Github. According the doc, the fallback is to set the 'sharp_local_prebuilds' npm config or the 'npm_config_sharp_local_prebuilds' env variable before install.
Here my .npmrc file content :
sharp_local_prebuilds=/mnt/d/Dev/Projects/testsharp/libvips-8.12.2-linux-x64.tar.br
I checked the npm config 'sharp_local_prebuilds'
Here my env var :
Now when I trying to install sharp with npm, the script try again to download the lib from github repository and fail.
Possible install-time or require-time problem
npm install
is the same as the architecture and platform of Node.js used at runtime.Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.Is this a problem with filesystem permissions?
If you are using npm v6 or earlier and installing as a
root
orsudo
user, have you tried with thenpm install --unsafe-perm
flag?If you are using npm v7 or later, does the user running
npm install
own the directory it is run in?If you are using the
ignore-scripts
feature ofnpm
, have you tried with thenpm install --ignore-scripts=false
flag?What is the complete output of running
npm install --verbose sharp
?What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?