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

Windows x64, sharp v0.25.1, The specified procedure could not be found #2125

Closed
Moebits opened this issue Mar 14, 2020 · 11 comments
Closed

Windows x64, sharp v0.25.1, The specified procedure could not be found #2125

Moebits opened this issue Mar 14, 2020 · 11 comments

Comments

@Moebits
Copy link
Contributor

Moebits commented Mar 14, 2020

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, Node v13.10.0
Are you using the latest version? Is the version currently in use as reported by npm ls sharp the same as the latest version as reported by npm view sharp dist-tags.latest?
Yes, v0.25.1
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?
N/A
What is the complete output of running npm install --verbose sharp? Have you checked this output for useful error messages?
As far as I'm aware there aren't any errors.

PS F:\Documents\Tenpi\Programming\Bots\Kisaragi> npm i --unsafe-perm --ignore-scripts=false --verbose sharp
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   '--unsafe-perm',
npm verb cli   '--ignore-scripts=false',
npm verb cli   '--verbose',
npm verb cli   'sharp'
npm verb cli ]
npm info using npm@6.13.7
npm info using node@v13.10.0
npm verb npm-session 5e7e10d3af031893
npm http fetch GET 304 https://registry.npmjs.org/sharp 145ms (from cache)
npm timing stage:loadCurrentTree Completed in 3553ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 68ms
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 1802ms
npm http fetch GET 304 https://registry.npmjs.org/color 103ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/semver 151ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/node-addon-api 206ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar 207ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/prebuild-install 211ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/color-string 70ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/simple-swizzle 56ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/is-arrayish 121ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/napi-build-utils 50ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/expand-template 73ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-fs 74ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minimist 80ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-stream 57ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/readable-stream 47ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/bl 104ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/chownr 179ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minizlib 185ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minipass 188ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/yallist 188ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs-minipass 194ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mkdirp 201ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/graceful-fs 80ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/natives 59ms (from cache)
npm WARN deprecated natives@1.1.6: This module relies on Node.js's internals and will break at some point. Do not use it, and update to graceful-fs@4.x.
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 7029ms
npm timing stage:loadIdealTree Completed in 9620ms
npm timing stage:generateActionsToTake Completed in 432ms
npm verb correctMkdir C:\Users\chris\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\chris\AppData\Roaming\npm-cache\_locks\staging-2124ee8e2c904a11.lock for F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\.staging
npm timing audit submit Completed in 1153ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 1158ms
npm timing audit body Completed in 18ms
npm timing action:extract Completed in 1612ms
npm info lifecycle graceful-fs@4.2.3~preuninstall: graceful-fs@4.2.3
npm info lifecycle graceful-fs@4.2.3~uninstall: graceful-fs@4.2.3
npm verb unbuild rmStuff graceful-fs@4.2.3 from F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules
npm verb unbuild rmStuff in F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\fstream\node_modules
npm info lifecycle graceful-fs@4.2.3~postuninstall: graceful-fs@4.2.3
npm timing action:unbuild Completed in 1005ms
npm timing action:remove Completed in 2471ms
npm timing action:finalize Completed in 2003ms
npm timing action:refresh-package-json Completed in 9821ms
npm info lifecycle ms@2.1.1~preinstall: ms@2.1.1
npm info lifecycle debug@4.1.1~preinstall: debug@4.1.1
npm info lifecycle safer-buffer@2.1.2~preinstall: safer-buffer@2.1.2
npm info lifecycle iconv-lite@0.4.24~preinstall: iconv-lite@0.4.24
npm info lifecycle sax@1.2.4~preinstall: sax@1.2.4
npm info lifecycle natives@1.1.6~preinstall: natives@1.1.6
npm info lifecycle graceful-fs@3.0.12~preinstall: graceful-fs@3.0.12
npm info lifecycle expand-template@2.0.3~preinstall: expand-template@2.0.3
npm info lifecycle minimist@1.2.5~preinstall: minimist@1.2.5
npm info lifecycle readable-stream@3.6.0~preinstall: readable-stream@3.6.0
npm info lifecycle bl@4.0.1~preinstall: bl@4.0.1
npm info lifecycle tar-stream@2.1.2~preinstall: tar-stream@2.1.2
npm info lifecycle tar-fs@2.0.0~preinstall: tar-fs@2.0.0
npm info lifecycle chownr@1.1.4~preinstall: chownr@1.1.4
npm info lifecycle mkdirp@1.0.3~preinstall: mkdirp@1.0.3
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 needle@2.3.0~preinstall: needle@2.3.0
npm info lifecycle node-addon-api@2.0.0~preinstall: node-addon-api@2.0.0
npm info lifecycle prebuild-install@5.3.3~preinstall: prebuild-install@5.3.3
npm info lifecycle semver@7.1.3~preinstall: semver@7.1.3
npm info lifecycle tar@6.0.1~preinstall: tar@6.0.1
npm info lifecycle sharp@0.25.1~preinstall: sharp@0.25.1
npm timing action:preinstall Completed in 1058ms
npm info linkStuff ms@2.1.1
npm info linkStuff debug@4.1.1
npm info linkStuff safer-buffer@2.1.2
npm info linkStuff iconv-lite@0.4.24
npm info linkStuff sax@1.2.4
npm info linkStuff natives@1.1.6
npm info linkStuff graceful-fs@3.0.12
npm info linkStuff expand-template@2.0.3
npm info linkStuff minimist@1.2.5
npm info linkStuff readable-stream@3.6.0
npm info linkStuff bl@4.0.1
npm info linkStuff tar-stream@2.1.2
npm info linkStuff tar-fs@2.0.0
npm info linkStuff chownr@1.1.4
npm info linkStuff mkdirp@1.0.3
npm verb linkBins [
npm verb linkBins   { mkdirp: 'bin/cmd.js' },
npm verb linkBins   'F:\\Documents\\Tenpi\\Programming\\Bots\\Kisaragi\\node_modules\\sharp\\node_modules\\tar\\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 needle@2.3.0
npm verb linkBins [
npm verb linkBins   { needle: 'bin/needle' },
npm verb linkBins   'F:\\Documents\\Tenpi\\Programming\\Bots\\Kisaragi\\node_modules\\fsevents\\node_modules\\.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff node-addon-api@2.0.0
npm info linkStuff prebuild-install@5.3.3
npm verb linkBins [
npm verb linkBins   { 'prebuild-install': 'bin.js' },
npm verb linkBins   'F:\\Documents\\Tenpi\\Programming\\Bots\\Kisaragi\\node_modules\\sharp\\node_modules\\.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff semver@7.1.3
npm verb linkBins [
npm verb linkBins   { semver: 'bin/semver.js' },
npm verb linkBins   'F:\\Documents\\Tenpi\\Programming\\Bots\\Kisaragi\\node_modules\\sharp\\node_modules\\.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff tar@6.0.1
npm info linkStuff sharp@0.25.1
npm timing action:build Completed in 1387ms
npm info lifecycle ms@2.1.1~install: ms@2.1.1
npm info lifecycle debug@4.1.1~install: debug@4.1.1
npm info lifecycle safer-buffer@2.1.2~install: safer-buffer@2.1.2
npm info lifecycle iconv-lite@0.4.24~install: iconv-lite@0.4.24
npm info lifecycle sax@1.2.4~install: sax@1.2.4
npm info lifecycle natives@1.1.6~install: natives@1.1.6
npm info lifecycle graceful-fs@3.0.12~install: graceful-fs@3.0.12
npm info lifecycle expand-template@2.0.3~install: expand-template@2.0.3
npm info lifecycle minimist@1.2.5~install: minimist@1.2.5
npm info lifecycle readable-stream@3.6.0~install: readable-stream@3.6.0
npm info lifecycle bl@4.0.1~install: bl@4.0.1
npm info lifecycle tar-stream@2.1.2~install: tar-stream@2.1.2
npm info lifecycle tar-fs@2.0.0~install: tar-fs@2.0.0
npm info lifecycle chownr@1.1.4~install: chownr@1.1.4
npm info lifecycle mkdirp@1.0.3~install: mkdirp@1.0.3
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 needle@2.3.0~install: needle@2.3.0
npm info lifecycle node-addon-api@2.0.0~install: node-addon-api@2.0.0
npm info lifecycle prebuild-install@5.3.3~install: prebuild-install@5.3.3
npm info lifecycle semver@7.1.3~install: semver@7.1.3
npm info lifecycle tar@6.0.1~install: tar@6.0.1
npm info lifecycle sharp@0.25.1~install: sharp@0.25.1

> sharp@0.25.1 install F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp
> (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-win32-x64.tar.gz
info sharp Creating F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\build\Release
info sharp Copying DLLs from F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\vendor\lib to F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\build\Release
prebuild-install info begin Prebuild-install version 5.3.3
prebuild-install info looking for cached prebuild @ C:\Users\chris\AppData\Roaming\npm-cache\_prebuilds\c70b6e-sharp-v0.25.1-napi-v3-win32-x64.tar.gz
prebuild-install http request GET https://github.com/lovell/sharp/releases/download/v0.25.1/sharp-v0.25.1-napi-v3-win32-x64.tar.gz
prebuild-install http 200 https://github.com/lovell/sharp/releases/download/v0.25.1/sharp-v0.25.1-napi-v3-win32-x64.tar.gz
prebuild-install info downloading to @ C:\Users\chris\AppData\Roaming\npm-cache\_prebuilds\c70b6e-sharp-v0.25.1-napi-v3-win32-x64.tar.gz.16356-949cdc9367b06.tmp      
prebuild-install info renaming to @ C:\Users\chris\AppData\Roaming\npm-cache\_prebuilds\c70b6e-sharp-v0.25.1-napi-v3-win32-x64.tar.gz
prebuild-install info unpacking @ C:\Users\chris\AppData\Roaming\npm-cache\_prebuilds\c70b6e-sharp-v0.25.1-napi-v3-win32-x64.tar.gz
prebuild-install info unpack resolved to F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\build\Release\sharp.node
prebuild-install info install Successfully installed prebuilt binary!
npm verb lifecycle sharp@0.25.1~install: unsafe-perm in lifecycle true
npm verb lifecycle sharp@0.25.1~install: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\node_modules\.bin;F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\.bin;C:\Python27\;C:\Python27\Scripts;F:\Programs\bin;C:\Python38\Scripts\;C:\Python38\;C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\Redis\;C:\opencv\build\x64\vc15\bin;C:\Program Files\CMake\bin;C:\Program Files\PuTTY\;C:\Program Files\PostgreSQL\11\bin;C:\MinGW\bin;C:\Program Files\Git\cmd;C:\ProgramData\chocolatey\lib\mpv.install\tools;F:\Programs\Java\bin;C:\Program Files\Microsoft\Web Platform Installer\;F:\Programs\PHP7;C:\ProgramData\ComposerSetup\bin;C:\Program Files\nodejs\;F:\Programs\FFMPEG\bin;F:\Programs\Lame;C:\Program Files\MongoDB\Server\4.2\bin;F:\Programs\sox;F:\Programs\timidity;C:\Users\chris\AppData\Local\Programs\Python\Python38-32\Scripts\;C:\Users\chris\AppData\Local\Programs\Python\Python38-32\;C:\Users\chris\AppData\Local\Microsoft\WindowsApps;C:\Users\chris\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\chris\AppData\Local\GitHubDesktop\bin;C:\Program Files\heroku\bin;C:\Users\chris\AppData\Roaming\Composer\vendor\bin;C:\Users\chris\AppData\Roaming\npm;F:\Programs\Docker Toolbox
npm verb lifecycle sharp@0.25.1~install: CWD: F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp
npm timing action:install Completed in 11462ms
npm info lifecycle ms@2.1.1~postinstall: ms@2.1.1
npm info lifecycle debug@4.1.1~postinstall: debug@4.1.1
npm info lifecycle safer-buffer@2.1.2~postinstall: safer-buffer@2.1.2
npm info lifecycle iconv-lite@0.4.24~postinstall: iconv-lite@0.4.24
npm info lifecycle sax@1.2.4~postinstall: sax@1.2.4
npm info lifecycle natives@1.1.6~postinstall: natives@1.1.6
npm info lifecycle graceful-fs@3.0.12~postinstall: graceful-fs@3.0.12
npm info lifecycle expand-template@2.0.3~postinstall: expand-template@2.0.3
npm info lifecycle minimist@1.2.5~postinstall: minimist@1.2.5
npm info lifecycle readable-stream@3.6.0~postinstall: readable-stream@3.6.0
npm info lifecycle bl@4.0.1~postinstall: bl@4.0.1
npm info lifecycle tar-stream@2.1.2~postinstall: tar-stream@2.1.2
npm info lifecycle tar-fs@2.0.0~postinstall: tar-fs@2.0.0
npm info lifecycle chownr@1.1.4~postinstall: chownr@1.1.4
npm info lifecycle mkdirp@1.0.3~postinstall: mkdirp@1.0.3
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 needle@2.3.0~postinstall: needle@2.3.0
npm info lifecycle node-addon-api@2.0.0~postinstall: node-addon-api@2.0.0
npm info lifecycle prebuild-install@5.3.3~postinstall: prebuild-install@5.3.3
npm info lifecycle semver@7.1.3~postinstall: semver@7.1.3
npm info lifecycle tar@6.0.1~postinstall: tar@6.0.1
npm info lifecycle sharp@0.25.1~postinstall: sharp@0.25.1
npm timing action:postinstall Completed in 1032ms
npm verb unlock done using C:\Users\chris\AppData\Roaming\npm-cache\_locks\staging-2124ee8e2c904a11.lock for F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\.staging
npm timing stage:executeActions Completed in 32671ms
npm timing stage:rollbackFailedOptional Completed in 301ms
npm timing stage:runTopLevelLifecycles Completed in 47358ms
npm verb saving [ { name: 'sharp', spec: '^0.25.1', 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 info lifecycle undefined~postshrinkwrap: undefined
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.9 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.9: 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.25.1
added 25 packages from 130 contributors, removed 1 package and audited 20420 packages in 49.307s

What is the output of running npx envinfo --binaries --system?

  System:
    OS: Windows 10 10.0.18362
    CPU: (4) x64 Intel(R) Core(TM) i3-8130U CPU @ 2.20GHz
    Memory: 1.14 GB / 5.88 GB
  Binaries:
    Node: 13.10.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.19.0 - C:\Users\chris\AppData\Roaming\npm\yarn.CMD
    npm: 6.13.7 - C:\Program Files\nodejs\npm.CMD

I have been trying for hours to get it to install correctly. The error I am getting is:

(node:10060) UnhandledPromiseRejectionWarning: Error: 
Something went wrong installing the "sharp" module

The specified procedure could not be found.
\\?\F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\build\Release\sharp.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.<anonymous> (F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\lib\constructor.js:34:9)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (F:\Documents\Tenpi\Programming\Bots\Kisaragi\node_modules\sharp\lib\index.js:3:15)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (F:\Documents\Tenpi\Programming\Bots\Kisaragi\dist\commands\image\blur.js:16:33)
    at Module._compile (internal/modules/cjs/loader.js:1147:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
    at Module.load (internal/modules/cjs/loader.js:996:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1036:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at F:\Documents\Tenpi\Programming\Bots\Kisaragi\dist\index.js:39:34
(node:10060) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:10060) [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.
@miranahf

This comment has been minimized.

@lovell
Copy link
Owner

lovell commented Mar 15, 2020

@Tenpi It looks like sharp itself installed OK but there's a problem at runtime, possibly relating to DLL files.

  • What is the contents of the node_modules\sharp\build\Release directory?
  • Are there any other native module dependencies e.g. node-canvas?
  • Does inspecting node_modules\sharp\build\Release\sharp.node with http://www.dependencywalker.com/ provide any insight?

@lovell lovell changed the title Something went wrong installing the "sharp" module Windows x64, sharp v0.25.1, The specified procedure could not be found Mar 15, 2020
@Moebits
Copy link
Contributor Author

Moebits commented Mar 15, 2020

@Tenpi It looks like sharp itself installed OK but there's a problem at runtime, possibly relating to DLL files.

  • What is the contents of the node_modules\sharp\build\Release directory?
  • Are there any other native module dependencies e.g. node-canvas?
  • Does inspecting node_modules\sharp\build\Release\sharp.node with http://www.dependencywalker.com/ provide any insight?

Thanks for the fast reply. With dependency walker I found some log files in sharp/build/Release/obj/libvips-cpp/libvips-cpp.tlog that say the following:

LINK-VCTIP.DELETE.1.TLOG - No DOS or PE signature found. This file is not a valid 32-bit or 64-bit Windows module.
Error: At least one file was not a 32-bit or 64-bit Windows module. 

These are the files in node_modules/sharp/build/Release:

Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----         3/7/2020   4:45 AM        1078784 libcairo-2.dll
-a----         3/7/2020   4:45 AM         234496 libexif-12.dll
-a----         3/7/2020   4:45 AM         182272 libexpat-1.dll
-a----         3/7/2020   4:45 AM          34304 libffi-7.dll
-a----         3/7/2020   4:45 AM         336384 libfontconfig-1.dll
-a----         3/7/2020   4:45 AM         723968 libfreetype-6.dll
-a----         3/7/2020   4:45 AM         124416 libfribidi-0.dll
-a----         3/7/2020   4:45 AM        1078251 libgcc_s_seh-1.dll
-a----         3/7/2020   4:45 AM         203776 libgdk_pixbuf-2.0-0.dll
-a----         3/7/2020   4:45 AM          47104 libgif-7.dll
-a----         3/7/2020   4:45 AM        1659904 libgio-2.0-0.dll
-a----         3/7/2020   4:45 AM        1576960 libglib-2.0-0.dll
-a----         3/7/2020   4:45 AM          24064 libgmodule-2.0-0.dll
-a----         3/7/2020   4:45 AM         355328 libgobject-2.0-0.dll
-a----         3/7/2020   4:45 AM         260608 libgsf-1-114.dll
-a----         3/7/2020   4:45 AM         990720 libharfbuzz.dll
-a----         3/7/2020   4:45 AM         965632 libiconv-2.dll
-a----         3/7/2020   4:45 AM         129024 libintl-8.dll
-a----         3/7/2020   4:45 AM         633344 libjpeg-62.dll
-a----         3/7/2020   4:45 AM         463872 liblcms2-2.dll
-a----         3/7/2020   4:45 AM         738816 liborc-0.4-0.dll
-a----         3/7/2020   4:45 AM         309248 libpango-1.0-0.dll
-a----         3/7/2020   4:45 AM          66560 libpangocairo-1.0-0.dll
-a----         3/7/2020   4:45 AM          85504 libpangoft2-1.0-0.dll
-a----         3/7/2020   4:45 AM          90112 libpangowin32-1.0-0.dll
-a----         3/7/2020   4:45 AM         995840 libpixman-1-0.dll
-a----         3/7/2020   4:45 AM         311296 libpng16-16.dll
-a----         3/7/2020   4:45 AM        2917376 librsvg-2-2.dll
-a----         3/7/2020   4:45 AM        1727750 libstdc++-6.dll
-a----         3/7/2020   4:45 AM         560640 libtiff-5.dll
-a----         3/7/2020   4:45 AM        5140992 libvips-42.dll
-a----         3/7/2020   4:58 PM         381440 libvips-cpp.dll
-a----         3/7/2020   4:45 AM         688640 libwebp-7.dll
-a----         3/7/2020   4:45 AM          24576 libwebpdemux-2.dll
-a----         3/7/2020   4:45 AM          47616 libwebpmux-3.dll
-a----         3/7/2020   4:45 AM        1572352 libxml2-2.dll
-a----         3/7/2020   4:45 AM         107008 libz1.dll
-a----         3/7/2020   4:58 PM         506368 sharp.node

I am using node-canvas in my project as well. Based on the error it looks like the files that were downloaded are not compatible with win32/64 bit (but I am not too sure).

@miranahf

This comment has been minimized.

@lovell
Copy link
Owner

lovell commented Mar 16, 2020

I am using node-canvas in my project as well.

Please can you temporarily remove this dependency and see if you still have the same problem.

@Moebits
Copy link
Contributor Author

Moebits commented Mar 18, 2020

Unfortunately wasn't able to solve this issue, I am using a different package instead. You don't have to resolve this issue (it's probably something weird that is specific to my machine).

@Moebits Moebits closed this as completed Mar 18, 2020
@LemuelKL
Copy link

LemuelKL commented Jul 4, 2020

I am using node-canvas in my project as well.

Please can you temporarily remove this dependency and see if you still have the same problem.

I am having exactly the same issue as OP's. I do also have node-canvas in my code. The error disappears when I removed all require('canvas') lines in my code. Thus I suspect too the installation of sharp is successful, but there is a dependencies incompatibility between node-canvas and sharp.

@lovell Should I open a new issue to provide more details? Thanks for your time.

@lovell
Copy link
Owner

lovell commented Jul 4, 2020

The prebuilt binaries provided by the forthcoming sharp v0.26.0 are switching from dynamically linked to statically linked, which should solve this class of problem, at least most of the time.

For now, if you're relying on a globally-installed libcairo for node-canvas, then you should also rely on a globally-installed libvips for sharp.

@valse
Copy link

valse commented Jul 29, 2020

For now, if you're relying on a globally-installed libcairo for node-canvas, then you should also rely on a globally-installed libvips for sharp.

Hi, I have the same issue and how can I do that?
I installed the gtk+-bundle_2.22.1-20101229_win64 and then I added the C:\GTK\bin directory to the PATH... but the error still occur :(
Thanks

@CoenraadS
Copy link

CoenraadS commented Aug 4, 2020

@lovell Can this issue be reopened until the 0.26 release? I am experiencing it also, and would like some way to be notified when the 0.26 release is available by subscribing to this thread.

@lovell
Copy link
Owner

lovell commented Aug 4, 2020

@CoenraadS New releases can be subscribed to via https://github.com/lovell/sharp/tags.atom (there's usually a small delay between a tag being created and publication to npm).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants