-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Not able to use locally downloaded prebuilt binaries
- I have read the documentation relating to installation.
- I have ensured that the architecture and platform of Node.js used for
npm installis the same as the architecture and platform of Node.js used at runtime.
Are you using the latest version of sharp?
- I am using the latest version of
sharpas 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 or sudo user, have you tried with the npm 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 of npm, have you tried with the npm install --ignore-scripts=false flag?
What is the complete output of running npm install --verbose sharp?
I am running this to also specify local binary directory path
export npm_config_sharp_local_prebuilds="/Users/ankur/workspace/phonepe/test-sharp/libs" && npm install --verbose sharp
Details
// Trimming a few good lines from above
npm info lifecycle prebuild-install@7.0.1~install: prebuild-install@7.0.1
npm info lifecycle sharp@0.30.3~install: sharp@0.30.3
> sharp@0.30.3 install /Users/ankur/workspace/phonepe/test-sharp/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-darwin-x64.tar.br
sharp: Installation error: connect ECONNREFUSED 127.0.0.1:443
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm verb lifecycle sharp@0.30.3~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.30.3~install: PATH: /Users/ankur/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/ankur/workspace/phonepe/test-sharp/node_modules/sharp/node_modules/.bin:/Users/ankur/workspace/phonepe/test-sharp/node_modules/.bin:/Users/ankur/.nvm/versions/node/v14.17.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/ankur/.nvm/versions/node/v14.17.6/bin
npm verb lifecycle sharp@0.30.3~install: CWD: /Users/ankur/workspace/phonepe/test-sharp/node_modules/sharp
npm info lifecycle sharp@0.30.3~install: Failed to exec install script
npm timing action:install Completed in 5009ms
npm verb unlock done using /Users/ankur/.npm/_locks/staging-ea960bc79e48be92.lock for /Users/ankur/workspace/phonepe/test-sharp/node_modules/.staging
npm timing stage:rollbackFailedOptional Completed in 199ms
npm timing stage:runTopLevelLifecycles Completed in 7715ms
npm verb stack Error: sharp@0.30.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
npm verb stack Exit status 1
npm verb stack at EventEmitter.<anonymous> (/Users/ankur/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
npm verb stack at EventEmitter.emit (events.js:400:28)
npm verb stack at ChildProcess.<anonymous> (/Users/ankur/.nvm/versions/node/v14.17.6/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
npm verb stack at ChildProcess.emit (events.js:400:28)
npm verb stack at maybeClose (internal/child_process.js:1055:16)
npm verb stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
npm verb pkgid sharp@0.30.3
npm verb cwd /Users/ankur/workspace/phonepe/test-sharp
npm verb Darwin 21.4.0
npm verb argv "/Users/ankur/.nvm/versions/node/v14.17.6/bin/node" "/Users/ankur/.nvm/versions/node/v14.17.6/bin/npm" "install" "--verbose" "sharp"
npm verb node v14.17.6
npm verb npm v6.14.15
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.30.3 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.30.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm verb exit [ 1, true ]
npm timing npm Completed in 8147ms
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/ankur/.npm/_logs/2022-04-12T07_27_32_138Z-debug.log
What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?
Details
npx: installed 1 in 1.398s
System:
OS: macOS 12.3.1
CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Memory: 57.88 MB / 16.00 GB
Shell: 5.1.8 - /usr/local/bin/bash
Binaries:
Node: 14.17.6 - ~/.nvm/versions/node/v14.17.6/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v14.17.6/bin/yarn
npm: 6.14.15 - ~/.nvm/versions/node/v14.17.6/bin/npm
Additional problem details
I have downloaded binaries to local
the libs structure looks like this
libs/
v8.10.5/
libvips-8.10.5-linux-x64.tar.br
v8.12.2/
libvips-8.12.2-linux-x64.tar.br
I'm setting the npm_config_sharp_local_prebuilds to use local binaries but It's not working. I checked the code of this repo also, but there's no such variable in the code itself.
On the other hand, I also tried to use hosted binaries using npm_config_sharp_libvips_binary_host and was able to install sharp successfully.