Takakiri
Takakiri

Reputation: 43

Can't install sharp on windows 10 (x64)

I'm trying to use node.js sharp to image processing on Windows 10, but require sharp-win32-x64.node is failed. The requested .node file exists. Why require is failed?

(Install Windows 10 and Git)
(open a git bash)
$ mkdir -p  try_sharp
$ cd  try_sharp
$ npm init -y
$ npm install sharp
$ npm list
[email protected] C:\Users\____\Desktop\try_sharp
└── [email protected]
$ ls node_modules/sharp/build/Release/
    libglib-2.0-0.dll*  libgobject-2.0-0.dll*  libvips-42.dll*  libvips-cpp.dll*  sharp-win32-x64.node*
$ code index.js  #// open a text editor
    const s = require('sharp');
$ code node_modules/sharp/lib/sharp.js
    before
        module.exports = require(`../build/Release/sharp-${platformAndArch}.node`);
    after
        console.log('-------------')
        console.log(platformAndArch)
        module.exports = require(`../build/Release/sharp-${platformAndArch}.node`);
        console.log('OK')
$ node index.js
    -------------
    win32-x64
    C:\Users\____\Desktop\try_sharp\node_modules\sharp\lib\sharp.js:33
        throw new Error(help.join('\n'));

    Error:
    Something went wrong installing the "sharp" module

    The specified module could not be found.
    \\?\C:\Users\____\Desktop\try_sharp\node_modules\sharp\build\Release\sharp-win32-x64.node

Upvotes: 0

Views: 6266

Answers (1)

Takakiri
Takakiri

Reputation: 43

I found a version-specific issue thread. My problem has been solved. Thanks. https://github.com/lovell/sharp/issues/3086

Upvotes: 2

Related Questions