#sharp error in new project

8 messages · Page 1 of 1 (latest)

valid meteor
#

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
error when starting dev server:
Error: Could not load the "sharp" module using the win32-x64 runtime
Possible solutions:

  • Add platform-specific dependencies:
    npm install --os=win32 --cpu=x64 sharp
    or
    npm install --force @img/sharp-win32-x64
  • Consult the installation documentation: https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (D:\Coding\personal\akiradev\node_modules.pnpm\[email protected]\node_modules\sharp\lib\sharp.js:85:9)
    at Module._compile (node:internal/modules/cjs/loader:1267:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
    at Module.load (node:internal/modules/cjs/loader:1125:32)
    at Module._load (node:internal/modules/cjs/loader:965:12)
    at Module.require (node:internal/modules/cjs/loader:1149:19)
    at require (node:internal/modules/helpers:121:18)
    at Object.<anonymous> (D:\Coding\personal\akiradev\node_modules.pnpm\[email protected]\node_modules\sharp\lib\constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1267:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1321:10)
     ELIFECYCLE  Command failed with exit code 1.

brand new project i cant seem to figure out how to fix the sharp error

compact raptor
#

@ me if there is a solution, for now all u can do I install the sharp module in ur project directory, that a solution that worked for me
Keep in mind installing globally didn't work for me, so each time u create a project u have to do it

tardy basin
#

Hi @valid meteor & @compact raptor :
I am getting started with Qwik and have run into this exact problem on OSX, node v20.3.0 using pnpm. Did you find a solution or a workaround?

Aside: I tried the recommendation of installing the sharp module but that didn't help in my case. Did you find a working solution for Mac/OSX?

valid meteor
#

iirc using npm instead of pnpm fixed it for me i dont remember tho

compact raptor
#

like just sharp

#

not the extra stuff it also asks

tardy basin