lovell / sharp

High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, AVIF and TIFF images. Uses the libvips library.
https://sharp.pixelplumbing.com
Apache License 2.0
28.85k stars 1.29k forks source link

Procedure not found: "sharp-win32-x64.node" #3766

Closed ipec closed 11 months ago

ipec commented 1 year ago

Possible install-time or require-time problem

Are you using the latest version of sharp?

Is this a problem with filesystem permissions?

If you are using the ignore-scripts feature of npm, have you tried with the npm install --ignore-scripts=false flag? Yes. No success.

What is the complete output of running npm install --verbose --foreground-scripts sharp in an empty directory?

λ npm install --verbose --foreground-scripts sharp npm verb cli D:\A P P S\code\nodejs\node.exe C:\Users\miles\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js npm info using npm@9.2.0 npm info using node@v20.5.1 npm verb title npm install sharp npm verb argv "install" "--loglevel" "verbose" "--foreground-scripts" "sharp" npm verb logfile logs-max:10 dir:C:\Users\miles\AppData\Local\npm-cache\_logs\2023-08-16T06_22_14_749Z- npm verb logfile C:\Users\miles\AppData\Local\npm-cache\_logs\2023-08-16T06_22_14_749Z-debug-0.log npm http fetch GET 200 https://registry.npmjs.org/sharp 24ms (cache hit) npm http fetch GET 200 https://registry.npmjs.org/semver 314ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/color 322ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/detect-libc 323ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/tar-fs 322ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/node-addon-api 327ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/tunnel-agent 329ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/simple-get 337ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/prebuild-install 949ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/github-from-package 94ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/simple-concat 93ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 101ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/mkdirp-classic 97ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/pump 103ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/decompress-response 130ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/node-abi 137ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/lru-cache 164ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/tar-stream 171ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/color-convert 191ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/rc 195ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/safe-buffer 188ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/once 202ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/minimist 210ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/color-string 217ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/napi-build-utils 663ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/expand-template 718ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/color-name 83ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/simple-swizzle 85ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/color-name 92ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/is-arrayish 67ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/chownr 69ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/end-of-stream 76ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/ini 83ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/deep-extend 89ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/strip-json-comments 89ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/wrappy 62ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/yallist 58ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/mimic-response 76ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/fast-fifo 83ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/b4a 92ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/streamx 102ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/queue-tick 79ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/inherits 66ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/fs-constants 72ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/readable-stream 80ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/bl 94ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/util-deprecate 61ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/string_decoder 64ms (cache revalidated) npm http fetch GET 200 https://registry.npmjs.org/buffer 108ms (cache updated) npm http fetch GET 200 https://registry.npmjs.org/ieee754 57ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/base64-js 60ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/streamx/-/streamx-2.15.1.tgz 174ms (cache miss) npm http fetch GET 200 https://registry.npmjs.org/node-abi/-/node-abi-3.46.0.tgz 178ms (cache miss) npm info run sharp@0.32.5 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) > sharp@0.32.5 install > (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy) sharp: Using cached C:\Users\miles\AppData\Local\npm-cache\_libvips\libvips-8.14.4-win32-x64.tar.brlibvips && node install/dll-copy && prebuild-install) [##################] - reify:sharp: info run sharp@0.32.5 install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install)sharp: Integrity check passed for win32-x64 sharp: Creating Q:\sharp\node_modules\sharp\build\Release install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) sharp: Copying DLLs from Q:\sharp\node_modules\sharp\vendor\8.14.4\win32-x64\lib to Q:\sharp\node_modules\sharp\build\Release prebuild-install info begin Prebuild-install version 7.1.1install node_modules/sharp (node install/libvips && node install/dll-copy && prebuild-install) prebuild-install info looking for local prebuild @ prebuilds\sharp-v0.32.5-napi-v7-win32-x64.tar.gz prebuild-install info looking for cached prebuild @ C:\Users\miles\AppData\Local\npm-cache\_prebuilds\e9ce9c-sharp-v0.32.5-napi-v7-win32-x64.tar.gz prebuild-install info found cached prebuild prebuild-install info unpacking @ C:\Users\miles\AppData\Local\npm-cache\_prebuilds\e9ce9c-sharp-v0.32.5-napi-v7-win32-x64.tar.gz prebuild-install info unpack resolved to Q:\sharp\node_modules\sharp\build\Release\sharp-win32-x64.node prebuild-install info install Successfully installed prebuilt binary! npm info run sharp@0.32.5 install { code: 0, signal: null } added 51 packages in 5s 10 packages are looking for funding run `npm fund` for details npm verb exit 0 npm info ok

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

System: OS: Windows 10 10.0.19045 CPU: (8) x64 Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz Memory: 17.56 GB / 23.97 GB Binaries: Node: 20.5.1 - D:\A P P S\code\nodejs\node.EXE npm: 9.2.0 - D:\A P P S\code\nodejs\npm.CMD npmPackages: sharp: ^0.32.5 => 0.32.5

Issue when upgrading from sharp@0.32.3 to sharp@0.32.5 on Windows 10 (64)

Error: Something went wrong installing the "sharp" module

The specified procedure could not be found. \?\E:\PROJECT\JS\Chatbot\Simon-AI\node_modules\sharp\build\Release\sharp-win32-x64.node

The following methods I tried with no avail:

Results from npm ls sharp and npm ls -g sharp are: λ npm ls sharp simon-ai-v14-esm@0.8.83 E:\PROJECT\JS\Chatbot\Simon-AI └── sharp@0.32.5 λ npm ls -g sharp C:\Users\miles\AppData\Roaming\npm └── (empty)

"sharp": "^0.32.3" works, any version above that does not unfortunately

lovell commented 1 year ago

Is canvas also a dependency? https://sharp.pixelplumbing.com/install#canvas-and-windows

ipec commented 1 year ago

canvas is installed, yes, but it worked with "sharp": "^0.32.3"

lovell commented 1 year ago

This is the ongoing glib symbol conflict between the binaries provided for Windows by canvas and sharp - https://github.com/Automattic/node-canvas/pull/813 will probably help.

ipec commented 1 year ago

Thanks for the link, but not sure it does help. Basically I have two choices, either I use a now deprecated static prebuild of canvas or I stay on "sharp": "^0.32.3". Neither of which is ideal.

lovell commented 11 months ago

Some version combinations will interoperate and some won't, it's ultimately down to the (potentially conflicting) versions of glib.

sharp will always expose the underlying glib version it is using via sharp.versions.glib, so perhaps you could use that to build a compatibility matrix? Good luck!