1
const { createCanvas, loadImage } = require('canvas')
const sharp = require("sharp");

This is my code.

  throw new Error(help.join('\n'));
  ^

Error:
Something went wrong installing the "sharp" module

The specified procedure could not be found.
\\?\C:\Users\Thaddea\Documents\ZLI\EDITS\js\fumo\node_modules\sharp\build\Release\sharp-win32-x64.node

Possible solutions:
- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"
- Install for the current runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (C:\Users\Thaddea\Documents\ZLI\EDITS\js\fumo\node_modules\[4msharp[24m\lib\sharp.js:30:9)
[90m    at Module._compile (node:internal/modules/cjs/loader:1101:14)[39m
[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)[39m
[90m    at Module.load (node:internal/modules/cjs/loader:981:32)[39m
[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)[39m
[90m    at Module.require (node:internal/modules/cjs/loader:1005:19)[39m
[90m    at require (node:internal/modules/cjs/helpers:102:18)[39m
    at Object.<anonymous> (C:\Users\Thaddea\Documents\ZLI\EDITS\js\fumo\node_modules\[4msharp[24m\lib\constructor.js:8:1)
[90m    at Module._compile (node:internal/modules/cjs/loader:1101:14)[39m
[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)[39m

The error I'm getting.

I tried:

npm install --ignore-scripts=false --verbose sharp

npm install --platform=win32 --arch=x64 sharp

Reinstalling sharp, rebuilding sharp via npm rebuild sharp --update-binary, reinstalling canvas, rebuilding canvas via npm rebuild canvas --update-binary

Any help?

Lilyn
  • 35
  • 5

1 Answers1

1

On Windows, you cannot use both sharp and canvas and there is no workaround.

check this --> https://github.com/lovell/sharp/issues/3007

hahaweweTMH
  • 26
  • 1
  • 3
  • 2
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Tyler2P Feb 05 '22 at 09:19