Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install fails with Request Timed Out Error. #3795

Closed
3 tasks done
krishna-santosh opened this issue Sep 11, 2023 · 12 comments
Closed
3 tasks done

Install fails with Request Timed Out Error. #3795

krishna-santosh opened this issue Sep 11, 2023 · 12 comments

Comments

@krishna-santosh
Copy link

krishna-santosh commented Sep 11, 2023

Possible install-time or require-time problem

  • I have read the documentation relating to installation.
  • I have ensured that the architecture and platform of Node.js used for npm install is 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 sharp as reported by npm 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 --foreground-scripts sharp in an empty directory?

❯ npm install --verbose --foreground-scripts sharp
npm verb cli /usr/bin/node /usr/bin/npm
npm info using npm@10.1.0
npm info using node@v20.6.1
npm verb title npm install sharp
npm verb argv "install" "--loglevel" "verbose" "--foreground-scripts" "sharp"
npm verb logfile logs-max:10 dir:/home/krishna/.npm/_logs/2023-09-11T12_22_19_124Z-
npm verb logfile /home/krishna/.npm/_logs/2023-09-11T12_22_19_124Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/sharp 47ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 49ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 57ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color 62ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 61ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/simple-get 62ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/semver 66ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 68ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 70ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-convert 115ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-string 115ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/expand-template 111ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 112ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/minimist 113ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 115ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 116ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/rc 114ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/node-abi 125ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/lru-cache 128ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/pump 149ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/decompress-response 144ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/simple-concat 141ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/once 150ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tar-stream 139ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 137ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 147ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-name 42ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/color-name 51ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 38ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 6ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 47ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/chownr 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/ini 39ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/deep-extend 45ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 41ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/wrappy 9ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/yallist 8ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/mimic-response 16ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/b4a 24ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/fast-fifo 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/streamx 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/queue-tick 7ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/fs-constants 39ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/bl 42ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/readable-stream 39ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/inherits 47ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/buffer 42ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/string_decoder 32ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 33ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/base64-js 14ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/ieee754 14ms (cache hit)
npm info run sharp@0.32.5 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)

sharp@0.32.5 install
(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.14.4/libvips-8.14.4-linux-x64.tar.brnstall/dll-copy && prebuild-instal
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 5496ms
sharp: Installation error: Request timed outch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 5496ms
sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm info run sharp@0.32.5 install { code: 1, signal: null }
npm verb stack Error: command failed
npm verb stack at ChildProcess. (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/lib/index.js:53:27)
npm verb stack at ChildProcess.emit (node:events:514:28)
npm verb stack at maybeClose (node:internal/child_process:1105:16)
npm verb stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
npm verb pkgid sharp@0.32.5
npm verb cwd /home/krishna/Code/Test/st
npm verb Linux 6.5.2-arch1-1
npm verb node v20.6.1
npm verb npm v10.1.0
npm ERR! code 1
npm ERR! path /home/krishna/Code/Test/st/node_modules/sharp
npm ERR! command failed
npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
npm verb exit 1
npm verb unfinished npm timer reify 1694434939599
npm verb unfinished npm timer reify:build 1694434941127
npm verb unfinished npm timer build 1694434941128
npm verb unfinished npm timer build:deps 1694434941128
npm verb unfinished npm timer build:run:install 1694434941143
npm verb unfinished npm timer build:run:install:node_modules/sharp 1694434941144
npm verb code 1

npm ERR! A complete log of this run can be found in: /home/krishna/.npm/_logs/2023-09-11T12_22_19_124Z-debug-0.log

What is the output of running npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp?

System:
OS: Linux 6.5 Arch Linux
CPU: (4) x64 Intel(R) Core(TM) i3-4005U CPU @ 1.70GHz
Memory: 1.14 GB / 3.73 GB
Container: Yes
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 20.6.1 - /usr/bin/node
npm: 10.1.0 - /usr/bin/npm
pnpm: 8.7.4 - /usr/bin/pnpm

@lovell
Copy link
Owner

lovell commented Sep 11, 2023

sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.4/libvips-8.14.4-linux-x64.tar.br
sharp: Installation error: Request timed out

It looks like there was a (temporary?) networking problem between the machine this was run on and GitHub.

@krishna-santosh
Copy link
Author

krishna-santosh commented Sep 11, 2023

This happens every time I install sharp (checked it again just now). When I download that file (libvips-8.14.4-linux-x64.tar.br) via browser it downloads fine.

@krishna-santosh
Copy link
Author

@lovell I also tried using the Chinese Mirror as mentioned in the installation docs

npm ERR! command failed
npm ERR! command sh -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://npmmirror.com/mirrors/sharp-libvips/v8.14.4/libvips-8.14.4-linux-x64.tar.br
npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies
npm ERR! sharp: Installation error: Request timed out

@estebancastro

This comment was marked as outdated.

@lovell
Copy link
Owner

lovell commented Sep 18, 2023

@estebancastro You have an unrelated issue - you are using v0.28.x that predates ARM64 on macOS - please upgrade. If you are still having problems please open a new installation issue.

Prebuilt sharp and libvips binaries have been provided for macOS on ARM64 since sharp v0.29.0.

https://sharp.pixelplumbing.com/install#apple-m1

@estebancastro

This comment was marked as off-topic.

@lovell
Copy link
Owner

lovell commented Sep 22, 2023

@estebancastro If you are still having problems please open a new installation issue. https://github.com/lovell/sharp/issues/new?labels=installation&template=installation.md

@lovell
Copy link
Owner

lovell commented Sep 26, 2023

The custom logic to download prebuilt binaries will be removed as part of #3750 and with it will disappear these kind of networking-related errors (or at least responsibility for them will shift to the package manager).

@tandav
Copy link

tandav commented Dec 11, 2023

I've solved the issue by turning off VPN

13.07 npm ERR! code 1                                                                                                                                                                                                                                                   
13.07 npm ERR! path /app/node_modules/sharp                                                                                                                                                                                                                             
13.07 npm ERR! command failed                                                                                                                                                                                                                                           
13.07 npm ERR! command sh -c (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)                                                                                             
13.07 npm ERR! sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.14.4/libvips-8.14.4-linux-x64.tar.br                                                                                                                                     
13.07 npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies                                                                                                                                                                      
13.07 npm ERR! sharp: Installation error: Request timed out         

@lovell
Copy link
Owner

lovell commented Dec 11, 2023

Please upgrade to v0.33.0 and this entire class of problem will go away.

@Mahmud-Aminu
Copy link

I solve this issue by installing windows-build-tools packages turn out sharp require windows-build-tools

@lovell
Copy link
Owner

lovell commented Dec 26, 2023

@Mahmud-Aminu sharp does not require windows-build-tools - please ensure you're using the latest version and if you still require help, please open a new installation issue.

Repository owner locked and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants