Did you see the documentation relating to installation?
Yes
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?
PS C:\test> npm i --verbose
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:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli 'i',
npm verb cli '--verbose'
npm verb cli ]
npm info using [email protected]
npm info using [email protected]
npm verb npm-session 6a9f850334ccbcc2
npm info lifecycle [email protected]~preinstall: [email protected]
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:\Users\Daniel\AppData\Roaming\npm-cache\_locks correctMkdir not in flight; initializing
npm verb makeCacheDir UID & GID are irrelevant on win32
npm verb lock using C:\Users\Daniel\AppData\Roaming\npm-cache\_locks\staging-2589f5e19af59211.lock for C:\test\node_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 [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm info lifecycle [email protected]~preinstall: [email protected]
npm timing action:preinstall Completed in 5ms
npm info linkStuff [email protected]
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 [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm info linkStuff [email protected]
npm timing action:build Completed in 14ms
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~install: [email protected]
> [email protected] install C:\test\node_modules\sharp
> (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:\test\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\test\node_modules\sharp\vendor\lib to C:\test\node_modules\sharp\build\Release
prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info looking for cached prebuild @ C:\Users\Daniel\AppData\Roaming\npm-cache\_prebuilds\07a02f-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:\Users\Daniel\AppData\Roaming\npm-cache\_prebuilds\07a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz.4436-7358a0dede41b.tmp
prebuild-install info renaming to @ C:\Users\Daniel\AppData\Roaming\npm-cache\_prebuilds\07a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz
prebuild-install info unpacking @ C:\Users\Daniel\AppData\Roaming\npm-cache\_prebuilds\07a02f-sharp-v0.23.4-node-v72-win32-x64.tar.gz
prebuild-install info unpack resolved to C:\test\node_modules\sharp\build\Release\sharp.node
prebuild-install info unpack required C:\test\node_modules\sharp\build\Release\sharp.node successfully
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle [email protected]~install: unsafe-perm in lifecycle true
npm verb lifecycle [email protected]~install: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\test\node_modules\sharp\node_modules\.bin;C:\test\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Program Files\PuTTY\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\HP\Common\HPDestPlgIn\;C:\AndroidSDK\platform-tools;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\Daniel\AppData\Local\Microsoft\WindowsApps;C:\Users\Daniel\AppData\Roaming\npm;C:\Program Files (x86)\EaseUS\Todo Backup\bin\x64\
npm verb lifecycle [email protected]~install: CWD: C:\test\node_modules\sharp
npm timing action:install Completed in 4673ms
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm timing action:postinstall Completed in 9ms
npm verb unlock done using C:\Users\Daniel\AppData\Roaming\npm-cache\_locks\staging-2589f5e19af59211.lock for C:\test\node_modules\.staging
npm timing stage:executeActions Completed in 5712ms
npm timing stage:rollbackFailedOptional Completed in 138ms
npm info linkStuff [email protected]
npm info lifecycle [email protected]~install: [email protected]
npm info lifecycle [email protected]~postinstall: [email protected]
npm info lifecycle [email protected]~prepublish: [email protected]
npm info lifecycle [email protected]~prepare: [email protected]
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 [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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: [email protected] (node_modules\nunjucks\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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: [email protected] (node_modules\glob-watcher\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: 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?
PS C:\test> npx envinfo --binaries --languages --system --utilities
npx: installed 1 in 1.187s
System:
OS: Windows 10 10.0.18362
CPU: (12) x64 Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz
Memory: 24.05 GB / 31.94 GB
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
npm: 6.13.4 - C:\Program Files\nodejs\npm.CMD
Utilities:
Git: 2.25.0. - C:\Program Files\Git\cmd\git.EXE
Languages:
Python: 2.7.17 - C:\Python27\python.EXE
Error message received:
PS C:\test> npm start
> [email protected] start C:\test
> gulp
Something went wrong installing the "sharp" module
The specified procedure could not be found.
\\?\C:\test\node_modules\gulp-imgconv\node_modules\sharp\build\Release\sharp.node
- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `gulp`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start 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:
npm ERR! C:\Users\Daniel\AppData\Roaming\npm-cache\_logs\2020-02-21T09_38_24_900Z-debug.log
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 馃憤
Hi, the install log has a filesystem path of C:\test\node_modules\sharp but the error has a filesystem path of C:\test\node_modules\gulp-imgconv\node_modules\sharp.
Thanks for responding so quickly.
C:\test\node_modules\gulp-imgconv\node_modules\sharp\build\Release\sharp.node seems to exist ok. If I delete the C:\test\node_modules\gulp-imgconv\node_modules\ folder and run npm install again I get the following:
PS C:\test> npm i
> [email protected] install C:\test\node_modules\gulp-imgconv\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\Daniel\AppData\Roaming\npm-cache\_libvips\libvips-8.7.4-win32-x64.tar.gz
info sharp Creating C:\test\node_modules\gulp-imgconv\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\test\node_modules\gulp-imgconv\node_modules\sharp\vendor\lib to C:\test\node_modules\gulp-imgconv\node_modules\sharp\build\Release
npm WARN [email protected] No repository field.
npm WARN The package gulp-imgconv is included as both a dev and production dependency.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\nunjucks\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\glob-watcher\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 2 packages from 55 contributors and audited 24774 packages in 7.703s
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
But with the same error on npm start 馃槙
Sharp is a very useful project, but these instabilities are driving me crazy. I have spent uncountable hours struggling with similar situation. From time to time, out of the blue this is what I get:
Error:
Something went wrong installing the "sharp" module
Module did not self-register.
- 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
I can't help because I don't know the root cause that triggers the issue.
@djfwilkinson Please can you upgrade to the latest v0.25.1.
Starting yesterday evening, I've run into this exact problem.
I use sharp in gatsby (via gatsby-plugin-sharp and gatsby-transformer-sharp)
On localhost, I hit the error "the specified procedure could not be found".
If I try to build the system on Netlify (using the same production code as March 19th, which built probably and without problem) I hit this:
Error: Something went wrong installing the "sharp" module
12:07:04 PM: Cannot find module '../build/Release/sharp.node'
12:07:04 PM: Require stack:
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp/lib/cons tructor.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp/lib/inde x.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-plugin-sharp/safe-sharp.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-plugin-sharp/index.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-plugin-sharp/gatsby-node.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby/dist/bootstrap/index.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby/dist/commands/build.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-cli/lib/create-cli.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby-cli/lib/index.js
12:07:04 PM: - /opt/build/repo/node_modules/gatsby/dist/bin/gatsby.js
12:07:04 PM: - Run "npm rebuild --verbose sharp" and look for errors
12:07:04 PM: - Consult the installation documentation at https://sharp.pixelplumbing.com/in stall
12:07:04 PM: - Search for this error at https://github.com/lovell/sharp/issues
This is the same code (the very same commit) that Netlify could build successfully just two days ago.
I've tried many things:
vendor folder, etc)I'm using yarn workspace so my gatsby site can inherit a local gatsby theme. Sharp works just fine if I build the gatsby theme (a sub-site). Sharp fails if I try to build the parent site.
This has worked for more than a year without trouble. I mentioned it here only in case sharp is confusing paths and such.
Any ideas would be helpful.
@djfwilkinson Were you able to make any progress with this after upgrading to the latest version (currently v0.25.2)?
I'm having the same issue recently.
I'm using gulp and some of its plugin and my own custom functions.
It works well, up until i added some other gulp plugins, the problem occured.
After looking through the log file, one of the newly added plugin, favicons (with gulp-favicons as its wrapper), has sharp as one of its depencency, with different version compare to my own dependencies.
my project's package.json:
{
"devDependencies": {
...,
"sharp": "^0.25.2",
....
}
}
favicons' package.json:
{
"dependencies": {
...,
"sharp": "^0.23.3",
....
}
}
So, what i do are:
npm cache clear --force & npm install --build-from-source
_OR_
npm cache clear --force & npm install --build-from-source
Both ways, solve the problem, at least for my case.
The last working version in my case was 0.24.1. All newer (up to 0.25.2) show the same error.
{
"dependencies": {
...,
"sharp": "~0.24.1",
....
}
}
Run npm i [email protected] to fix the problem.
@abdihaikal Please can you submit a PR to favicons to upgrade sharp to the latest (v0.25.2).
I concur with @GermanBluefox
On my Windows 10 system with Node 12.14.0 I had the same exact issues as the OP until I tried sharp 0.24.1
I highly recommend upgrading sharp to the latest v0.25.x as internally it uses N-API, which provides ABI stability and allows you do things like upgrading/changing the major version of Node.js without having to re-install.
If sharp appears more than once in the dependency tree and you notice one (or more) of the (transitive) dependencies have yet to upgrade, such as the favicons example, please can you open a PR to upgrade that module as it will benefit all users of it.
@djfwilkinson I hope this information helped. Please feel free to re-open with more details if further assistance is required.
To anyone else experiencing this problem, please ensure all (transitive) dependencies are using the same, latest version of sharp. This might mean that you have to open a PR to upgrade the version of sharp used by favicons etc.
Most helpful comment
Sharp is a very useful project, but these instabilities are driving me crazy. I have spent uncountable hours struggling with similar situation. From time to time, out of the blue this is what I get:
I can't help because I don't know the root cause that triggers the issue.