Npm sharp error

Guide on troubleshooting failing NPM install of Sharp with the command failed error!

Introduction

I was playing around with the NPM Sharp package (https://sharp.pixelplumbing.com/) and noticed a few error depending on the machine I was using.

When I run the Gatsby template or Gridsome (Vue template), I get the following the error as

node_modules/sharp: Command failed. Exit code: 1

This post I will track down various errors that can come up when trying to install and use the NPM sharp package.

The error “NPM sharp command failed” is usually caused by:

  • Not installing the latest version of NPM sharp
  • Using a old version of libvips
  • Not having Python installed on your machine
  • Using incorrect version of Node or NPM (minimum of Node.js >= 14.15.0)

A common error that spits out is:

  

error /<path to the project>/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments: 
Directory: /<path to the project>/node_modules/sharp
Output:
info sharp Using cached /home/username/.npm/_libvips/libvips-8.8.1-linux-x64.tar.gz
ERR! sharp Please delete /home/username/.npm/_libvips/libvips-8.8.1-linux-x64.tar.gz as it is not a valid tarball

The reason why the error NPM sharp command failed is that NPM sharp is not installed correctly. To fix the error of we can do the following:

  1. Use the command npm install --unsafe-perm
  2. Clear NPM cache and reinstall NPM sharp
  3. Try using Yarn instead of NPM
  4. On OSX with M1, try reinstalling VIPS

What is NPM sharp package?

NPM sharp is a node package that allows you to convert large images to smaller ones that are web-friendly JPEG, PNG, WebP, GIF and AVIF images of varying dimensions.

Typically this is used during the build and deploy phase of your website — we want to scale down images so that they are optimized and loads fast for users.

It is powered by the blazingly fast libvips (that is written in C) image processing library, originally created in 1989 at Birkbeck College. Currently, it is maintained by a small team led by John Cupitt.

1. Use the command npm install --unsafe-perm

When you are trying to install NPM sharp on NPM version v6 or earlier, consider using the --unsafe-perm flag when installing as root or a sudo user.

npm install --unsafe-perm

So what is this --unsafe-perm setting?

This is more relevant with Node version 6 or earlier, the documentation states:

Set to true to suppress the UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.

Essentially what this means is to tell NPM to run scripts as the root user (which has access to everything within your system).

So for example, if we dont have the --unsafe-perm flag turned on and ran under sudo npm install, NPM itself will have safeguards to not run scripts as root (defaulting to the current executing user or groups).

With the flag --unsafe-perm to true, we can override this tell NPM to go ahead. We can see that in the NPM code itself:

  

function loadUid(cb) {
  // if we're not in unsafe-perm mode, then figure out who
  // to run stuff as.  Do this first, to support `npm update npm -g`
  if (!this.get('unsafe-perm')) {
    getUid(this.get('user'), this.get('group'), cb);
  } else {
    process.nextTick(cb);
  }
}

2. Clear NPM cache and reinstall the latest version NPM sharp

Since NPM sharp uses the libvips library and failing install — one reason could be that you have incompatible cached version of libvips.

We can try to delete the current cached version of libvips, deleting cached libvips tarball to fix the issue.

npm cache clean -f

The above just tells NPM to clear its cache of package modules and their dependencies. This way, the next time you need to install the same package in another project it will go to the cached store instead of NPM registry to download it again.

Then we also need to remove libvips — replace the <username> with your username:

rm -rf /Users/{username}/.npm/_libvips

We als need to make sure to uninstall libvips completely from our system just to be sure:

npm -g uninstall libvips

Then try to install NPM sharp with the --unsafe-perm flag

npm install --unsafe-perm

3. Try using Yarn instead of NPM

Sometimes common issues with NPM install such as this one is not a problem in YARN.

YARN is just another package manager but comes up better in my opinion in performance, security and better at managing dependencies.

We can install the Sharp library as so:

yarn sharp

4. On Mac (OSX) with M1, try reinstalling vips

As of (2023) somehow the NPM sharp does not work well with Mac OSX M1 systems. A option to fix this is to try to reinstall vips

As an example, I came across this issue when I was trying to setup a Gatsby project.

Firstly, open up the terminal and go to your root directory. Also make sure to remove node_modules and package-lock.json.

Then run the following commands:

  

xcode-select --install
brew install gcc
brew reinstall vips
brew info vips
npm i

From the above set of commands, we first want to make sure to install the xcode-select — this will install the XCode Command Line Tools.

You’ll see a panel that asks you to install Xcode Command Line Tools. A window will pop up asking you to continue. Click through the prompts until it successfully downloaded!

Then run the following to see if you have installed successfully:

xcode-select -p

If installed correctly, you will see:

/Library/Developer/CommandLineTools

The next line is to get brew to install gcc.

brew install gcc

NPM sharp uses libvips behind the scenes which is written in C. There we will need to make sure gcc is installed as our C compiler.

Tip: May not need to install vips with v0.29.0+

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

The next we can reinstall vips (which is the libvips) with

brew reinstall vips.

Hopefully after this it should not show the NPM sharp command failed error again and we can continue with

npm install

Tip: Consider your operating system

If you are on these systems, you do not have to worry about libvips, since Sharp installation will come with the prebuilt binaries for libvips:

  • macOS x64 (>= 10.13)
  • macOS ARM64
  • Linux x64 (glibc >= 2.17, musl >= 1.1.24, CPU with SSE4.2)
  • Linux ARM64 (glibc >= 2.17, musl >= 1.1.24)
  • Windows x64
  • Windows x86

The following platforms require compilation of both libvips and sharp from source:

  • Linux x86
  • Linux ARMv7 (glibc <= 2.27, musl)
  • Linux ARMv6 (glibc <= 2.27, musl)
  • Linux PowerPC
  • FreeBSD
  • OpenBSD

Refer to this install guide to check on support for your system: https://sharp.pixelplumbing.com/install

Summary

In this post, we had a look at why installing the popular NPM sharp library is failing with error NPM sharp command failed.

It comes down to making sure that we got the dependencies right. NPM sharp uses the libvips C library to manage the image processing and has this as the dependency. If we are installing NPM sharp with NPM v6 or earlier, have a look at using the --unsafe-perm flag.

When you are installing the sharp package on Mac (OSX) make sure to install gcc and vips correctly.

Additionally, make sure to have Node version v14+ installed or instead of using NPM as the package manager, consider using Yarn!

Lastly, we need to consider the operating system that we are installing sharp on. There are certain systems that comes prebundled with the binaries (libvips) and others you will need to compile the binaries yourself!

update: the issue is probably caused by webpack-node-externals.
#2517 (comment)


I use sharp but I got this error:

D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:150011
  throw new Error(error);
  ^

Error:
Something went wrong installing the "sharp" module

node-loader:
Error: The specified module could not be found.
D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserver/33c1e48f049ce3285905e286d212a201.node

- Remove the "node_modules/sharp" directory then run
  "npm install --ignore-scripts=false --verbose" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/install
- Search for this error at https://github.com/lovell/sharp/issues

    at Object.EmBj (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:150011:9)
    at __webpack_require__ (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:27:30)
    at Object.Tbcg (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:251632:15)
    at __webpack_require__ (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:27:30)
    at Module.dMKD (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:324313:63)
    at __webpack_require__ (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:27:30)
    at Module.mWHM (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:405859:77)
    at __webpack_require__ (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:27:30)
    at Module.WXK/ (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:271250:65)
    at __webpack_require__ (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:27:30)
    at D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:118:18
    at Object.<anonymous> (D:Downloads__projectsdevNodeJs@eng-dibongxdistcmscoreserverexpress.js:121:10)
←[90m    at Module._compile (internal/modules/cjs/loader.js:1156:30)←[39m
←[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1176:10)←[39m
←[90m    at Module.load (internal/modules/cjs/loader.js:1000:32)←[39m
←[90m    at Function.Module._load (internal/modules/cjs/loader.js:899:14)←[39m
←[90m    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)←[39m
←[90m    at internal/main/run_main_module.js:18:47←[39m

** minimal reproduction:**
#2517 (comment)

I removed sharp from ‘node_modules` then reinstalled it, but got the same error

> npm cache clean -f
> npm i --verbose sharp@latest

the verbose output of installing sharp is:


D:Downloads__projectsdevNodeJs@eng-dibongx>npm i --verbose sharp@latest
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   'C:\Program Files\nodejs\node.exe',
npm verb cli   'C:\Users\eldeeb\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
npm verb cli   'i',
npm verb cli   '--verbose',
npm verb cli   'sharp@latest'
npm verb cli ]
npm info using npm@6.9.0
npm info using node@v12.16.2
npm verb npm-session c41d87c77d3d7180
npm http fetch GET 200 https://registry.npmjs.org/sharp 1417ms
npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.27.0.tgz 644ms
npm timing stage:loadCurrentTree Completed in 6364ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 37ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1936ms
npm http fetch GET 200 https://registry.npmjs.org/array-flatten 218ms
npm http fetch GET 200 https://registry.npmjs.org/array-flatten/-/array-flatten-3.0.0.tgz 278ms
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 507ms
npm http fetch GET 200 https://registry.npmjs.org/npmlog 511ms
npm http fetch GET 200 https://registry.npmjs.org/simple-get 545ms
npm http fetch GET 200 https://registry.npmjs.org/tar-fs 638ms
npm http fetch GET 200 https://registry.npmjs.org/semver 643ms
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 654ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc 659ms
npm http fetch GET 200 https://registry.npmjs.org/prebuild-install/-/prebuild-install-6.0.0.tgz 156ms
npm http fetch GET 200 https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz 158ms
npm http fetch GET 200 https://registry.npmjs.org/simple-get/-/simple-get-4.0.0.tgz 151ms
npm http fetch GET 200 https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz 468ms
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-7.3.4.tgz 471ms
npm http fetch GET 200 https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz 464ms
npm http fetch GET 200 https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.1.0.tgz 644ms
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet 122ms
npm http fetch GET 200 https://registry.npmjs.org/gauge 306ms
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings 319ms
npm http fetch GET 200 https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz 424ms
npm http fetch GET 200 https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz 436ms
npm http fetch GET 200 https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz 626ms
npm http fetch GET 200 https://registry.npmjs.org/delegates 182ms
npm http fetch GET 200 https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz 355ms
npm http fetch GET 200 https://registry.npmjs.org/has-unicode 150ms
npm http fetch GET 200 https://registry.npmjs.org/wide-align 158ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi 166ms
npm http fetch GET 200 https://registry.npmjs.org/string-width 170ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz 216ms
npm http fetch GET 200 https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz 232ms
npm http fetch GET 200 https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz 242ms
npm http fetch GET 200 https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz 323ms
npm http fetch GET 200 https://registry.npmjs.org/code-point-at 248ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point 260ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz 335ms
npm http fetch GET 200 https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz 364ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan 221ms
npm http fetch GET 200 https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz 198ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex 294ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz 235ms
npm http fetch GET 200 https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz 129ms
npm http fetch GET 200 https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz 659ms
npm http fetch GET 200 https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz 673ms
npm http fetch GET 200 https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz 167ms
npm http fetch GET 200 https://registry.npmjs.org/expand-template 196ms
npm http fetch GET 200 https://registry.npmjs.org/which-pm-runs 441ms
npm http fetch GET 200 https://registry.npmjs.org/noop-logger 445ms
npm http fetch GET 200 https://registry.npmjs.org/node-abi 449ms
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 456ms
npm http fetch GET 200 https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz 448ms
npm http fetch GET 200 https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz 263ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 473ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package 479ms
npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz 549ms
npm http fetch GET 200 https://registry.npmjs.org/node-abi/-/node-abi-2.19.3.tgz 557ms
npm http fetch GET 200 https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz 575ms
npm http fetch GET 200 https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz 580ms
npm http fetch GET 200 https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz 561ms
npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz 571ms
npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-5.7.1.tgz 336ms
npm http fetch GET 200 https://registry.npmjs.org/simple-concat 280ms
npm http fetch GET 200 https://registry.npmjs.org/decompress-response 299ms
npm http fetch GET 200 https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz 131ms
npm http fetch GET 200 https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz 147ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response 213ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz 183ms
npm http fetch GET 200 https://registry.npmjs.org/tar-stream 206ms
npm http fetch GET 200 https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz 293ms
npm http fetch GET 200 https://registry.npmjs.org/fs-constants 162ms
npm http fetch GET 200 https://registry.npmjs.org/bl 202ms
npm http fetch GET 200 https://registry.npmjs.org/readable-stream 228ms
npm http fetch GET 200 https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz 188ms
npm http fetch GET 200 https://registry.npmjs.org/bl/-/bl-4.0.3.tgz 157ms
npm http fetch GET 200 https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz 154ms
npm http fetch GET 200 https://registry.npmjs.org/buffer 858ms
npm http fetch GET 200 https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz 159ms
npm http fetch GET 200 https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz 245ms
npm http fetch GET 200 https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz 105ms
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 17386ms
npm timing stage:loadIdealTree Completed in 20212ms
npm timing stage:generateActionsToTake Completed in 251ms
npm verb correctMkdir C:UserseldeebAppDataRoamingnpm-cache_locks correctMkdir not in flight; initializing
npm verb makeDirectory C:UserseldeebAppDataRoamingnpm-cache_locks creation not in flight; initializing
npm verb makeCacheDir UID & GID are irrelevant on win32
npm verb lock using C:UserseldeebAppDataRoamingnpm-cache_locksstaging-ff976866a950c511.lock for D:Downloads__projectsdevNodeJs@eng-dibongxnode_modules.stag
ing
npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz 250ms
npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz 260ms
npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.2.13.tgz 255ms
npm timing action:extract Completed in 304ms
npm info lifecycle undefined~preuninstall: undefined
npm info lifecycle undefined~uninstall: undefined
npm timing action:unbuild Completed in 10ms
npm timing action:remove Completed in 0ms
npm timing action:finalize Completed in 60ms
npm timing action:refresh-package-json Completed in 105ms
npm info lifecycle array-flatten@3.0.0~preinstall: array-flatten@3.0.0
npm info lifecycle semver@7.3.4~preinstall: semver@7.3.4
npm info lifecycle sharp@0.27.0~preinstall: sharp@0.27.0
npm timing action:preinstall Completed in 17ms
npm info linkStuff array-flatten@3.0.0
npm info linkStuff semver@7.3.4
npm verb linkBins [
npm verb linkBins   { semver: 'bin/semver.js' },
npm verb linkBins   'D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\node_modules\sharp\node_modules\.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff sharp@0.27.0
npm timing action:build Completed in 70ms
npm info lifecycle array-flatten@3.0.0~install: array-flatten@3.0.0
npm info lifecycle semver@7.3.4~install: semver@7.3.4
npm info lifecycle sharp@0.27.0~install: sharp@0.27.0

> sharp@0.27.0 install D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-win32-x64.tar.br
info sharp Creating D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharpbuildRelease
info sharp Copying DLLs from D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharpvendor8.10.5lib to D:Downloads__projectsdevNodeJs@eng-dibongxnod
e_modulessharpbuildRelease
prebuild-install info begin Prebuild-install version 6.0.0
prebuild-install info looking for cached prebuild @ C:UserseldeebAppDataRoamingnpm-cache_prebuilds9cc5aa-sharp-v0.27.0-napi-v3-win32-x64.tar.gz
prebuild-install info found cached prebuild
prebuild-install info unpacking @ C:UserseldeebAppDataRoamingnpm-cache_prebuilds9cc5aa-sharp-v0.27.0-napi-v3-win32-x64.tar.gz
prebuild-install info unpack resolved to D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharpbuildReleasesharp.node
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle sharp@0.27.0~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.27.0~install: PATH: C:UserseldeebAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;D:Downloads__projectsdevNo
deJs@eng-dibongxnode_modulessharpnode_modules.bin;D:Downloads__projectsdevNodeJs@eng-dibongxnode_modules.bin;C:Program Files (x86)InteliCLS Client;C:Pr
ogram FilesInteliCLS Client;C:ProgramDataOracleJavajavapath;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C:
Program Files (x86)WinMerge;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program
Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)SkypePhone;C:
Program FilesMicrosoft SQL Server110ToolsBinn;C:Program Files (x86)QuickTimeQTSystem;C:Program FilesGitcmd;C:Program Filesnodejs;C:Program Files (x86)Yar
nbin;C:Program Filesherokubin;C:UserseldeebAppDataRoamingnpm;C:UserseldeebAppDataLocalatombin;C:UserseldeebAppDataLocalYarnbin
npm verb lifecycle sharp@0.27.0~install: CWD: D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharp
npm timing audit submit Completed in 6102ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 6102ms
npm timing audit body Completed in 1ms
npm timing action:install Completed in 30506ms
npm info lifecycle array-flatten@3.0.0~postinstall: array-flatten@3.0.0
npm info lifecycle semver@7.3.4~postinstall: semver@7.3.4
npm info lifecycle sharp@0.27.0~postinstall: sharp@0.27.0
npm timing action:postinstall Completed in 9ms
npm verb unlock done using C:UserseldeebAppDataRoamingnpm-cache_locksstaging-ff976866a950c511.lock for D:Downloads__projectsdevNodeJs@eng-dibongxnode_module
s.staging
npm timing stage:executeActions Completed in 31157ms
npm timing stage:rollbackFailedOptional Completed in 19ms
npm timing stage:runTopLevelLifecycles Completed in 58678ms
npm verb saving [ { name: 'sharp', spec: '^0.27.0', save: 'dependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle undefined~shrinkwrap: undefined
npm verb shrinkwrap skipping write for package-lock.json because there were no changes.
npm info lifecycle undefined~postshrinkwrap: undefined
npm WARN @angular-devkit/build-angular@0.1001.7 requires a peer of @angular/localize@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @angular-devkit/build-angular@0.1001.7 requires a peer of ng-packagr@^10.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @fortawesome/angular-fontawesome@0.6.1 requires a peer of @angular/core@^9.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN @fortawesome/angular-fontawesome@0.6.1 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself.
npm WARN jsdom@16.4.0 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-loading@8.0.0 requires a peer of @angular/common@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN ngx-loading@8.0.0 requires a peer of @angular/core@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.0.1 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@10.0.1 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-subresource-integrity@1.4.1 requires a peer of html-webpack-plugin@^2.21.0 || ~3 || >=4.0.0-alpha.2 <5 but none is installed. You must install peer depen
dencies yourself.
npm WARN ws@7.4.0 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws@7.4.0 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_moduleswebpack-dev-servernode_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_moduleswatchpack-chokidar2node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS:    darwin
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch:  any
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS:   win32
npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64

+ sharp@0.27.0
added 3 packages from 69 contributors and audited 1986 packages in 60.317s
found 11 vulnerabilities (7 low, 1 moderate, 3 high)
  run `npm audit fix` to fix them, or `npm audit` for details
npm verb exit [ 0, true ]
npm timing npm Completed in 60904ms
npm info ok

I added node-loader to webpack:

config.module.rules.push(
    { test: /.ts$/, loader: "ts-loader" },
    {
      test: /.node$/,
      use: "node-loader"
    }
  );

webpack config:

{
    mode: 'development',
    devtool: false,
    profile: false,
    resolve: {
      roots: [Array],
      extensions: [Array],
      symlinks: false,
      modules: [Array],
      plugins: [Array],
      mainFields: [Array],
      alias: [Object]
    },
    resolveLoader: { symlinks: true, modules: [Array], plugins: [Array] },
    context: 'D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx',
    entry: {
      express: 'D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\projects\cms\server\express.ts'
    },
    output: {
      futureEmitAssets: true,
      path: 'D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\dist\cms\core\server',
      publicPath: undefined,
      filename: '[name].js',
      libraryTarget: 'commonjs-module'
    },
    watch: false,
    watchOptions: { poll: undefined, ignored: undefined },
    performance: { hints: false },
    module: { strictExportPresence: true, rules: [Array] },
    optimization: { minimizer: [], moduleIds: 'hashed', noEmitOnErrors: true },
    plugins: [
      [ContextReplacementPlugin],
      [DedupeModuleResolvePlugin],
      [ProgressPlugin],
      [CircularDependencyPlugin],
      NamedLazyChunksPlugin {},
      [BundleBudgetPlugin],
      [ContextReplacementPlugin],
      [ContextReplacementPlugin],
      [SourceMapDevToolPlugin],
      [AnyComponentStyleBudgetChecker],
      [AngularCompilerPlugin],
      [IgnoreNotFoundExportPlugin]
    ],
    target: 'node',
    node: false,
    externals: [ [Function], [Function] ],
    stats: {
      colors: true,
      hash: true,
      timings: true,
      chunks: true,
      chunkModules: false,
      children: false,
      modules: false,
      reasons: false,
      warnings: true,
      errors: true,
      assets: true,
      version: false,
      errorDetails: false,
      moduleTrace: false
    }
  }

all node_modules are added to webpack.externals
OS: windows 8.1

Содержание

  1. Cannot install sharp node 16 #2887
  2. Comments
  3. Something went wrong installing the «sharp» module #2517
  4. Comments
  5. Linux Error installing sharp #1627
  6. Comments
  7. Windows, gulp-imgconv, gulp-favicons, Something went wrong installing the «sharp» module. The specified procedure could not be found. #2093
  8. Comments

Cannot install sharp node 16 #2887

npm ERR! remove_cv npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: ‘remove_cv’ declared here npm ERR! template struct _LIBCPP_TEMPLATE_VIS remove_cv npm ERR! ^ npm ERR! 1 error generated. npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1 npm ERR! gyp ERR! build error npm ERR! gyp ERR! stack Error: `make` failed with exit code: 2 npm ERR! gyp ERR! stack at ChildProcess.onExit (/Users/steve/Sites/brighter-futures/node_modules/node-gyp/lib/build.js:262:23) npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28) npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) npm ERR! gyp ERR! System Darwin 20.6.0 npm ERR! gyp ERR! command «/usr/local/Cellar/node/16.9.0/bin/node» «/Users/steve/Sites/brighter-futures/node_modules/.bin/node-gyp» «rebuild» npm ERR! gyp ERR! cwd /Users/steve/Sites/brighter-futures/node_modules/favicons/node_modules/sharp npm ERR! gyp ERR! node -v v16.9.0 npm ERR! gyp ERR! node-gyp -v v3.8.0 npm ERR! gyp ERR! not ok npm ERR! A complete log of this run can be found in: npm ERR! /Users/steve/.npm/_logs/2021-09-14T13_06_11_323Z-debug.log****»>

The text was updated successfully, but these errors were encountered:

Hi, it looks like you’re using sharp v0.23.x (July 2019) with Node.js 16 (April 2021). Please can you upgrade sharp.

Hey Thanks for the swift reply what is giving you the indication I am using v0.23.x ?

I am getting the same error with npm i sharp

what is giving you the indication I am using v0.23.x ?

sharp v0.23.x provided libvips v8.8.1

npm ERR! info sharp Using cached /Users/steve/.npm/_libvips/libvips-8.8.1-darwin-x64.tar.gz

I am getting the same error with npm i sharp

What is the complete output of running npm install —verbose sharp ?

npm ERR! remove_cv
npm ERR! /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/v1/type_traits:776:50: note: ‘remove_cv’ declared here
npm ERR! template struct _LIBCPP_TEMPLATE_VIS remove_cv
npm ERR! ^
npm ERR! 1 error generated.
npm ERR! make: *** [Release/obj.target/sharp/src/common.o] Error 1
npm ERR! gyp ERR! build error
npm ERR! gyp ERR! stack Error: make failed with exit code: 2
npm ERR! gyp ERR! stack at ChildProcess.onExit (/Users/steve/Sites/brighter-futures/node_modules/node-gyp/lib/build.js:262:23)
npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:394:28)
npm ERR! gyp ERR! stack at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
npm ERR! gyp ERR! System Darwin 20.6.0
npm ERR! gyp ERR! command «/usr/local/Cellar/node/16.9.0/bin/node» «/Users/steve/Sites/brighter-futures/node_modules/.bin/node-gyp» «rebuild»
npm ERR! gyp ERR! cwd /Users/steve/Sites/brighter-futures/node_modules/favicons/node_modules/sharp
npm ERR! gyp ERR! node -v v16.9.0
npm ERR! gyp ERR! node-gyp -v v3.8.0
npm ERR! gyp ERR! not ok
npm verb exit 1
npm timing npm Completed in 76490ms
npm verb unfinished npm timer reify 1631627300634
npm verb unfinished npm timer reify:build 1631627355354
npm verb unfinished npm timer build 1631627355359
npm verb unfinished npm timer build:deps 1631627355360
npm verb unfinished npm timer build:run:install 1631627355872
npm verb unfinished npm timer build:run:install:node_modules/favicons/node_modules/sharp 1631627355902
npm verb code 1

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/steve/.npm/_logs/2021-09-14T13_49_36_487Z-debug.log

npm info run sharp@0.23.4 install node_modules/favicons/node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

This suggests you’ll need to upgrade the favicons package.

Seems to be pulling in all sorts here. Probably not an issue with this package my bad.

Источник

Something went wrong installing the «sharp» module #2517

update: the issue is probably caused by webpack-node-externals.
#2517 (comment)

I use sharp but I got this error:

I removed sharp from ‘node_modules` then reinstalled it, but got the same error

the verbose output of installing sharp is:

preuninstall: undefined npm info lifecycle undefined

uninstall: undefined npm timing action:unbuild Completed in 10ms npm timing action:remove Completed in 0ms npm timing action:finalize Completed in 60ms npm timing action:refresh-package-json Completed in 105ms npm info lifecycle array-flatten@3.0.0

preinstall: array-flatten@3.0.0 npm info lifecycle semver@7.3.4

preinstall: semver@7.3.4 npm info lifecycle sharp@0.27.0

preinstall: sharp@0.27.0 npm timing action:preinstall Completed in 17ms npm info linkStuff array-flatten@3.0.0 npm info linkStuff semver@7.3.4 npm verb linkBins [ npm verb linkBins < semver: ‘bin/semver.js’ >, npm verb linkBins ‘D:\Downloads\__projects\dev\NodeJs\@eng-dibo\ngx\node_modules\sharp\node_modules\.bin’, npm verb linkBins false npm verb linkBins ] npm info linkStuff sharp@0.27.0 npm timing action:build Completed in 70ms npm info lifecycle array-flatten@3.0.0

install: array-flatten@3.0.0 npm info lifecycle semver@7.3.4

install: semver@7.3.4 npm info lifecycle sharp@0.27.0

install: sharp@0.27.0 > sharp@0.27.0 install D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharp > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-win32-x64.tar.br info sharp Creating D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharpbuildRelease info sharp Copying DLLs from D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharpvendor8.10.5lib to D:Downloads__projectsdevNodeJs@eng-dibongxnod e_modulessharpbuildRelease prebuild-install info begin Prebuild-install version 6.0.0 prebuild-install info looking for cached prebuild @ C:UserseldeebAppDataRoamingnpm-cache_prebuilds9cc5aa-sharp-v0.27.0-napi-v3-win32-x64.tar.gz prebuild-install info found cached prebuild prebuild-install info unpacking @ C:UserseldeebAppDataRoamingnpm-cache_prebuilds9cc5aa-sharp-v0.27.0-napi-v3-win32-x64.tar.gz prebuild-install info unpack resolved to D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharpbuildReleasesharp.node prebuild-install info install Successfully installed prebuilt binary! npm verb lifecycle sharp@0.27.0

install: unsafe-perm in lifecycle true npm verb lifecycle sharp@0.27.0

install: PATH: C:UserseldeebAppDataRoamingnpmnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;D:Downloads__projectsdevNo deJs@eng-dibongxnode_modulessharpnode_modules.bin;D:Downloads__projectsdevNodeJs@eng-dibongxnode_modules.bin;C:Program Files (x86)InteliCLS Client;C:Pr ogram FilesInteliCLS Client;C:ProgramDataOracleJavajavapath;C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0;C: Program Files (x86)WinMerge;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsIPT;C:Program Files (x86)SkypePhone;C: Program FilesMicrosoft SQL Server110ToolsBinn;C:Program Files (x86)QuickTimeQTSystem;C:Program FilesGitcmd;C:Program Filesnodejs;C:Program Files (x86)Yar nbin;C:Program Filesherokubin;C:UserseldeebAppDataRoamingnpm;C:UserseldeebAppDataLocalatombin;C:UserseldeebAppDataLocalYarnbin npm verb lifecycle sharp@0.27.0

install: CWD: D:Downloads__projectsdevNodeJs@eng-dibongxnode_modulessharp npm timing audit submit Completed in 6102ms npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 6102ms npm timing audit body Completed in 1ms npm timing action:install Completed in 30506ms npm info lifecycle array-flatten@3.0.0

postinstall: array-flatten@3.0.0 npm info lifecycle semver@7.3.4

postinstall: semver@7.3.4 npm info lifecycle sharp@0.27.0

postinstall: sharp@0.27.0 npm timing action:postinstall Completed in 9ms npm verb unlock done using C:UserseldeebAppDataRoamingnpm-cache_locksstaging-ff976866a950c511.lock for D:Downloads__projectsdevNodeJs@eng-dibongxnode_module s.staging npm timing stage:executeActions Completed in 31157ms npm timing stage:rollbackFailedOptional Completed in 19ms npm timing stage:runTopLevelLifecycles Completed in 58678ms npm verb saving [ < name: ‘sharp’, spec: ‘^0.27.0’, save: ‘dependencies’ >] npm verb shrinkwrap skipping write for package.json because there were no changes. npm info lifecycle undefined

preshrinkwrap: undefined npm info lifecycle undefined

shrinkwrap: undefined npm verb shrinkwrap skipping write for package-lock.json because there were no changes. npm info lifecycle undefined

postshrinkwrap: undefined npm WARN @angular-devkit/build-angular@0.1001.7 requires a peer of @angular/localize@^10.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @angular-devkit/build-angular@0.1001.7 requires a peer of ng-packagr@^10.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @fortawesome/angular-fontawesome@0.6.1 requires a peer of @angular/core@^9.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @fortawesome/angular-fontawesome@0.6.1 requires a peer of tslib@^1.10.0 but none is installed. You must install peer dependencies yourself. npm WARN jsdom@16.4.0 requires a peer of canvas@^2.5.0 but none is installed. You must install peer dependencies yourself. npm WARN ngx-loading@8.0.0 requires a peer of @angular/common@^8.0.0 but none is installed. You must install peer dependencies yourself. npm WARN ngx-loading@8.0.0 requires a peer of @angular/core@^8.0.0 but none is installed. You must install peer dependencies yourself. npm WARN sass-loader@10.0.1 requires a peer of node-sass@^4.0.0 but none is installed. You must install peer dependencies yourself. npm WARN sass-loader@10.0.1 requires a peer of fibers@>= 3.1.0 but none is installed. You must install peer dependencies yourself. npm WARN webpack-subresource-integrity@1.4.1 requires a peer of html-webpack-plugin@^2.21.0 ||

Источник

Linux Error installing sharp #1627

I have been working on development on the mac and it seems to be working fine so I thought on deployment things could be just fine since the docs are pretty much similar for installation.

Unfortunately, I am getting the following error log:

is the building mainly failing because of the Linux version no being drawing or something else is happening here?

I am currently using Ubuntu 16.04 and I tried installing using sudo npm install —save sharp I also tried using npm install —build-from-source

The text was updated successfully, but these errors were encountered:

The salient part of this error is:

You’ll need to ensure whatever user is running npm install has the relevant filesystem permissions. Avoid using sudo/root if possible. If you have to, pass the npm install —unsafe-perm flag.

Strange thing is that the user I tried the install has is not the root user but it has sudo privileges and would install about anything without any problem also I tried using the service terminal and it had the same issue.

At the end your solution worked using npm install —unsafe-perm I am not sure about this flag capability I could not find it as a reference on npm but thanks for all

Sorry but I thought things were fine but they are not.

I managed to install sharp and I tried running it with my pipe scripts but its not working so I tried installing everything again to make sure the installation was correct but I get a different warning now about libvips

correct if I am wrong but it says in the docs: libvips and its dependencies are fetched and stored within node_modules/sharp/vendor during npm install

I am not understanding where this libvips should live, globally or within the app module folder in the sharp directory, nevertheless, none of these attempts worked so far.

Источник

Windows, gulp-imgconv, gulp-favicons, Something went wrong installing the «sharp» module. The specified procedure could not be found. #2093

Have you ensured the platform and version of Node.js used for npm install is the same as the platform and version of Node.js used at runtime?
Yes, v12.16.1 and 6.13.4 .

If you are installing as a root or sudo user, have you tried with the npm install —unsafe-perm flag?
n/a

If you are using the ignore-scripts feature of npm , have you tried with the npm install —ignore-scripts=false flag?
I’m not using this. Makes no difference.

What is the complete output of running npm install —verbose sharp ? Have you checked this output for useful error messages?

preinstall: debug-sharp-issue@0.0.1 npm timing stage:loadCurrentTree Completed in 1287ms npm timing stage:loadIdealTree:cloneCurrentTree Completed in 17ms npm timing stage:loadIdealTree:loadShrinkwrap Completed in 873ms npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 924ms npm timing stage:loadIdealTree Completed in 2171ms npm timing stage:generateActionsToTake Completed in 98ms npm verb correctMkdir C:UsersDanielAppDataRoamingnpm-cache_locks correctMkdir not in flight; initializing npm verb makeCacheDir UID & GID are irrelevant on win32 npm verb lock using C:UsersDanielAppDataRoamingnpm-cache_locksstaging-2589f5e19af59211.lock for C:testnode_modules.staging npm http fetch GET 200 https://registry.npmjs.org/semver/-/semver-6.3.0.tgz 208ms npm http fetch GET 200 https://registry.npmjs.org/tar/-/tar-5.0.5.tgz 204ms npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz 240ms npm http fetch GET 200 https://registry.npmjs.org/minipass/-/minipass-3.1.1.tgz 208ms npm http fetch GET 200 https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz 209ms npm http fetch GET 200 https://registry.npmjs.org/minizlib/-/minizlib-2.1.0.tgz 208ms npm http fetch GET 200 https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz 212ms npm http fetch GET 200 https://registry.npmjs.org/sharp/-/sharp-0.23.4.tgz 224ms npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz 486ms npm http fetch GET 200 https://registry.npmjs.org/fsevents/-/fsevents-1.2.11.tgz 458ms npm timing action:extract Completed in 579ms npm timing audit submit Completed in 736ms npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 736ms npm timing audit body Completed in 1ms npm timing action:finalize Completed in 210ms npm timing action:refresh-package-json Completed in 177ms npm info lifecycle semver@6.3.0

preinstall: semver@6.3.0 npm info lifecycle yallist@4.0.0

preinstall: yallist@4.0.0 npm info lifecycle minipass@3.1.1

preinstall: minipass@3.1.1 npm info lifecycle fs-minipass@2.1.0

preinstall: fs-minipass@2.1.0 npm info lifecycle minizlib@2.1.0

preinstall: minizlib@2.1.0 npm info lifecycle tar@5.0.5

preinstall: tar@5.0.5 npm info lifecycle sharp@0.23.4

preinstall: sharp@0.23.4 npm timing action:preinstall Completed in 5ms npm info linkStuff semver@6.3.0 npm verb linkBins [ npm verb linkBins < semver: ‘bin/semver.js’ >, npm verb linkBins ‘C:\test\node_modules\sharp\node_modules\.bin’, npm verb linkBins false npm verb linkBins ] npm info linkStuff yallist@4.0.0 npm info linkStuff minipass@3.1.1 npm info linkStuff fs-minipass@2.1.0 npm info linkStuff minizlib@2.1.0 npm info linkStuff tar@5.0.5 npm info linkStuff sharp@0.23.4 npm timing action:build Completed in 14ms npm info lifecycle semver@6.3.0

install: semver@6.3.0 npm info lifecycle yallist@4.0.0

install: yallist@4.0.0 npm info lifecycle minipass@3.1.1

install: minipass@3.1.1 npm info lifecycle fs-minipass@2.1.0

install: fs-minipass@2.1.0 npm info lifecycle minizlib@2.1.0

install: minizlib@2.1.0 npm info lifecycle tar@5.0.5

install: tar@5.0.5 npm info lifecycle sharp@0.23.4

install: sharp@0.23.4 > sharp@0.23.4 install C:testnode_modulessharp > (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy) info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.8.1/libvips-8.8.1-win32-x64.tar.gz info sharp Creating C:testnode_modulessharpbuildRelease info sharp Copying DLLs from C:testnode_modulessharpvendorlib to C:testnode_modulessharpbuildRelease prebuild-install info begin Prebuild-install version 5.3.3 prebuild-install info looking for cached prebuild @ C:UsersDanielAppDataRoamingnpm-cache_prebuilds7a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.23.4/sharp-v0.23.4-node-v72-win32-x64.tar.gz prebuild-install http 200 https://github.com/lovell/sharp/releases/download/v0.23.4/sharp-v0.23.4-node-v72-win32-x64.tar.gz prebuild-install info downloading to @ C:UsersDanielAppDataRoamingnpm-cache_prebuilds7a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz.4436-7358a0dede41b.tmp prebuild-install info renaming to @ C:UsersDanielAppDataRoamingnpm-cache_prebuilds7a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz prebuild-install info unpacking @ C:UsersDanielAppDataRoamingnpm-cache_prebuilds7a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz prebuild-install info unpack resolved to C:testnode_modulessharpbuildReleasesharp.node prebuild-install info unpack required C:testnode_modulessharpbuildReleasesharp.node successfully prebuild-install info install Successfully installed prebuilt binary! npm verb lifecycle sharp@0.23.4

install: unsafe-perm in lifecycle true npm verb lifecycle sharp@0.23.4

install: PATH: C:Program Filesnodejsnode_modulesnpmnode_modulesnpm-lifecyclenode-gyp-bin;C:testnode_modulessharpnode_modules.bin;C:testnode_modules.bin;C:Python27;C:Python27Scripts;C:Windowssystem32;C:Windows;C:WindowsSystem32Wbem;C:WindowsSystem32WindowsPowerShellv1.0;C:WindowsSystem32OpenSSH;C:Program Files (x86)NVIDIA CorporationPhysXCommon;C:Program FilesNVIDIA CorporationNVIDIA NvDLISR;C:Program FilesPuTTY;C:Program Files (x86)IntelIntel(R) Management Engine ComponentsDAL;C:Program FilesIntelIntel(R) Management Engine ComponentsDAL;C:Program Files (x86)HPCommonHPDestPlgIn;C:AndroidSDKplatform-tools;C:Program FilesGitcmd;C:Program Filesnodejs;C:ProgramDatachocolateybin;C:UsersDanielAppDataLocalMicrosoftWindowsApps;C:UsersDanielAppDataRoamingnpm;C:Program Files (x86)EaseUSTodo Backupbinx64 npm verb lifecycle sharp@0.23.4

install: CWD: C:testnode_modulessharp npm timing action:install Completed in 4673ms npm info lifecycle semver@6.3.0

postinstall: semver@6.3.0 npm info lifecycle yallist@4.0.0

postinstall: yallist@4.0.0 npm info lifecycle minipass@3.1.1

postinstall: minipass@3.1.1 npm info lifecycle fs-minipass@2.1.0

postinstall: fs-minipass@2.1.0 npm info lifecycle minizlib@2.1.0

postinstall: minizlib@2.1.0 npm info lifecycle tar@5.0.5

postinstall: tar@5.0.5 npm info lifecycle sharp@0.23.4

postinstall: sharp@0.23.4 npm timing action:postinstall Completed in 9ms npm verb unlock done using C:UsersDanielAppDataRoamingnpm-cache_locksstaging-2589f5e19af59211.lock for C:testnode_modules.staging npm timing stage:executeActions Completed in 5712ms npm timing stage:rollbackFailedOptional Completed in 138ms npm info linkStuff debug-sharp-issue@0.0.1 npm info lifecycle debug-sharp-issue@0.0.1

install: debug-sharp-issue@0.0.1 npm info lifecycle debug-sharp-issue@0.0.1

postinstall: debug-sharp-issue@0.0.1 npm info lifecycle debug-sharp-issue@0.0.1

prepublish: debug-sharp-issue@0.0.1 npm info lifecycle debug-sharp-issue@0.0.1

prepare: debug-sharp-issue@0.0.1 npm timing stage:runTopLevelLifecycles Completed in 9755ms npm verb saving [] npm verb shrinkwrap skipping write for package.json because there were no changes. npm info lifecycle undefined

preshrinkwrap: undefined npm info lifecycle undefined

shrinkwrap: undefined npm verb shrinkwrap skipping write for package-lock.json because there were no changes. npm info lifecycle undefined

postshrinkwrap: undefined npm WARN debug-sharp-issue@0.0.1 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modulesfsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted <«os»:»darwin»,»arch»:»any»>(current: <«os»:»win32″,»arch»:»x64″>) npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32 npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modulesnunjucksnode_modulesfsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted <«os»:»darwin»,»arch»:»any»>(current: <«os»:»win32″,»arch»:»x64″>) npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32 npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modulesglob-watchernode_modulesfsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted <«os»:»darwin»,»arch»:»any»>(current: <«os»:»win32″,»arch»:»x64″>) npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32 npm verb notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64 added 7 packages from 61 contributors and audited 24765 packages in 10.43s 33 packages are looking for funding run `npm fund` for details found 4 vulnerabilities (2 low, 2 high) run `npm audit fix` to fix them, or `npm audit` for details npm verb exit [ 0, true ] npm timing npm Completed in 11256ms npm info»>

What is the output of running npx envinfo —binaries —languages —system —utilities ?

Error message received:

I’ve seen a few of these in the closed errors section but I didn’t spot anything that fixed my issue.

Further information: I have another project (an older one) which still works. Yesterday I managed to get this project working by manually copying the built Release directory across into the relevant node_modules . This doesn’t seem to work today 😞

Hopefully i’ve just missed something. Let me know if you need any more info. Thanks 👍

The text was updated successfully, but these errors were encountered:

Источник

При установке пакета Nodejs Browsertime я получил следующую ошибку.

npm install browsertime -g
/usr/bin/browsertime -> /usr/lib/node_modules/browsertime/bin/browsertime.js

> @sitespeed.io/chromedriver@77.0.3865-40 install /usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/chromedriver
> node install.js

(node:26690) UnhandledPromiseRejectionWarning: Error: Destination Folder must exist
    at DownloaderHelper.__validate (/usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/chromedriver/node_modules/node-downloader-helper/dist/index.js:390:23)
    at new DownloaderHelper (/usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/chromedriver/node_modules/node-downloader-helper/dist/index.js:61:20)
    at download (/usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/chromedriver/install.js:68:18)
(node:26690) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26690) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

> @sitespeed.io/geckodriver@0.26.0 install /usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/geckodriver
> node install.js

(node:26701) UnhandledPromiseRejectionWarning: Error: Destination Folder must exist
    at DownloaderHelper.__validate (/usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/geckodriver/node_modules/node-downloader-helper/dist/index.js:387:23)
    at new DownloaderHelper (/usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/geckodriver/node_modules/node-downloader-helper/dist/index.js:61:20)
    at download (/usr/lib/node_modules/browsertime/node_modules/@sitespeed.io/geckodriver/install.js:73:18)
(node:26701) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26701) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

> sharp@0.23.0 install /usr/lib/node_modules/browsertime/node_modules/sharp
> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

ERR! sharp EACCES: permission denied, mkdir '/root/.npm/_libvips'
info sharp Attempting to build from source via node-gyp but this may fail due to the above error
info sharp Please see https://sharp.pixelplumbing.com/page/install for required dependencies
gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/11.15.0"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/lib/node_modules/browsertime/node_modules/sharp/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/browsertime/node_modules/sharp/.node-gyp'
gyp ERR! System Linux 3.10.0-957.27.2.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/browsertime/node_modules/sharp
gyp ERR! node -v v11.15.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sharp@0.23.0 install: `(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sharp@0.23.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

Я попробовал несколько вещей, но ничего не получалось.

После небольшого поиска я нашел документацию по npmjs и попробовал --unsafe-perm

npm install --unsafe-perm

Я надеюсь, что это вам тоже поможет.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Npm python error
  • Npm publish error 403
  • Npm proxy error
  • Npm install sqlite3 error
  • Npm install package json error

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии