Closed daicheng123 closed 2 years ago
Hi, the salient part of the first log you've provided is:
sharp: Installation error: EPERM: operation not permitted, lchown '/home/jenkins/agent/workspace/wholee-m_feature_dayu/node_modules/sharp/vendor/8.12.2/linux-x64/lib'
This suggests you're trying to use sudo
and may have run into one of the npm v8 "features" around filesystem ownership, which is causing quite a lot of backscatter - see https://github.com/npm/rfcs/issues/546
The second log says:
sharp: Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.12.2/libvips-8.12.2-linux-x64.tar.br sharp: Installation error: Download incomplete (connection was terminated)
This suggests there were networking problems, perhaps temporary, during installation.
Just wanted to add a note that I had an intermittent failure installing the libvips
tarball that prevented npm install sharp
from succeeding. The message was a bit different from OP (no explicit permission or terminated connection errors, just an invalid tarball when trying to extract).
Retrying the build worked fine for me.
@daicheng123 Were you able to make any progress with this?
Closing due to inactivity but please feel free to reopen with more details if further help is required.
i've been having issues trying to install sharp also, This is the issue i'm getting:
npm ERR! code 1 npm ERR! path C:\inetpub\wwwroot\snowform\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.13.3/libvips-8.13.3-win32-x64.tar.br npm ERR! sharp: Please see https://sharp.pixelplumbing.com/install for required dependencies npm ERR! sharp: Installation error: tunneling socket could not be established, statusCode=400
@stuartcornes "tunneling socket could not be established" suggests there's a misconfigured proxy, e.g. HTTPS vs HTTP etc.
https://github.com/lovell/sharp/search?q=%22tunneling+socket+could+not+be+established%22&type=issues
Please open a new installation issue if further help is required.
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
.I use 0.30.1 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 --foreground-scripts sharp
in an empty directory?What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?