lovell / sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
https://sharp.pixelplumbing.com
Apache License 2.0
28.93k stars 1.29k forks source link

Installing on offline environment #2047

Closed josephstgh closed 4 years ago

josephstgh commented 4 years ago

Hi,

I am working in offline environment with self-hosted jfrog repo so following the instruction, I have set to point to custom url

npm config set sharp_dist_base_url "https://hostname/path/"

So based on the log, it seem that the libvips-8.9.0-win32-x64.tar.gz is being downloaded from the path I set. However, the installation still fails.

I have looked over the logs and it seem like it is also trying to download some other packages. Here's a partial log on the failure portion.

> sharp@0.24.0 install D:\workspace\o\ws\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Using cached C:\Users\bw\AppData\Roaming\npm-cache\_libvips\libvips-8.9.0-win32-x64.tar.gz
info sharp Creating D:\workspace\o\ws\node_modules\sharp\build\Release
info sharp Copying DLLs from D:\workspace\o\ws\node_modules\sharp\vendor\lib to D:\workspace\o\ws\node_modules\sharp\build\Release
prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info looking for cached prebuild @ C:\Users\bw\AppData\Roaming\npm-cache\_prebuilds\280cfa-sharp-v0.24.0-node-v72-win32-x64.tar.gz
prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.24.0/sharp-v0.24.0-node-v72-win32-x64.tar.gz
prebuild-install WARN install getaddrinfo EAI_AGAIN github.com

D:\workspace\o\ws\node_modules\sharp>if not defined npm_config_node_gyp (node "C:\Users\bw\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild )  else (node "C:\Users\bw\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
gyp info it worked if it ends with ok

Notice that it is trying to download sharp-v0.24.0-node-v72-win32-x64.tar.gz from Github

Further down the stack, it also has this, not sure if it's a issue as well.

gyp verb install --ensure was passed, so won't reinstall if already installed
gyp verb install version not already installed, continuing with install 12.13.0
gyp verb ensuring nodedir is created C:\Users\bw\AppData\Local\node-gyp\Cache\12.13.0
gyp verb created nodedir C:\Users\bw\AppData\Local\node-gyp\Cache\12.13.0
gyp http GET https://nodejs.org/download/release/v12.13.0/node-v12.13.0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp verb command remove [ '12.13.0' ]
gyp verb remove using node-gyp dir: C:\Users\bw\AppData\Local\node-gyp\Cache
gyp verb remove removing target version: 12.13.0
gyp verb remove removing development files for version: 12.13.0
gyp ERR! configure error
gyp ERR! stack Error: getaddrinfo EAI_AGAIN nodejs.org
gyp ERR! stack     at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:60:26)
gyp ERR! System Windows_NT 10.0.17763
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\bw\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\workspace\o\ws\node_modules\sharp
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5

Question is how do I set the config so that it will point to my repo to download these files?

Thanks

lovell commented 4 years ago

Hi, did you see the "To install the prebuilt sharp binaries from a custom URL..." section of https://sharp.pixelplumbing.com/install#custom-prebuilt-binaries ?

josephstgh commented 4 years ago

Sorry, my bad. I missed out the link below.

Thanks!

futpib commented 5 months ago

Hi, did you see the "To install the prebuilt sharp binaries from a custom URL..." section of sharp.pixelplumbing.com/install#custom-prebuilt-binaries ?

There is no "To install the prebuilt sharp binaries from a custom URL..." there

lovell commented 5 months ago

@futpib This issue is outdated. Please ensure you are using the latest version of sharp and consult the installation docs at https://sharp.pixelplumbing.com/install

If you still require help, please open a new installation issue and answer all of the questions.