qwik icon indicating copy to clipboard operation
qwik copied to clipboard

[🐞] - Blank project not running - Sharp Error

Open jdgamble555 opened this issue 1 year ago • 3 comments

Which component is affected?

Starters / CLI

Describe the bug

I just created a brand new Qwik project, selected all default options, and empty app. I then run npm start, and I get this:

error when starting dev server:
Error: Could not load the "sharp" module using the win32-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
    yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=win32 --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (C:\web projects\qwik-firebase\node_modules\sharp\lib\sharp.js:114:9)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (C:\web projects\qwik-firebase\node_modules\sharp\lib\constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)

I think there is a sharp error.

J

Reproduction

npm create qwik@latest

Steps to reproduce

Just create and install a new project with the latest version using blank app, then npm start.

System Info

Windows 11, VS Code, Powershell

Additional Information

No response

jdgamble555 avatar Feb 23 '24 02:02 jdgamble555

@jdgamble555 does updating your node version or installing the sharp dependency fix the issue?

thejackshelton avatar Feb 24 '24 07:02 thejackshelton

Nope, does nothing.

I tried again from scratch:

npm create qwik@latest

qwik-test

Empty App

Dependencies - Y

New Git - Y

Joke - Y

open vs code terminal - npm start

And I get this error:

error when starting dev server:
Error: Could not load the "sharp" module using the win32-x64 runtime
Possible solutions:
- Ensure optional dependencies can be installed:
    npm install --include=optional sharp
    yarn add sharp --ignore-engines
- Ensure your package manager supports multi-platform installation:
    See https://sharp.pixelplumbing.com/install#cross-platform
- Add platform-specific dependencies:
    npm install --os=win32 --cpu=x64 sharp
- Consult the installation documentation:
    See https://sharp.pixelplumbing.com/install
    at Object.<anonymous> (C:\web projects\qwik-firebase\node_modules\sharp\lib\sharp.js:114:9)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
    at Module.load (node:internal/modules/cjs/loader:1119:32)
    at Module._load (node:internal/modules/cjs/loader:960:12)
    at Module.require (node:internal/modules/cjs/loader:1143:19)
    at require (node:internal/modules/cjs/helpers:119:18)
    at Object.<anonymous> (C:\web projects\qwik-firebase\node_modules\sharp\lib\constructor.js:10:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)

So I tried following the instructions:

npm install --include=optional sharp
npm install --os=win32 --cpu=x64 sharp

Same error message.

I tried updating node. I was using v18.18.0, and now I'm using v20.11.1. I get the same error.

J

jdgamble555 avatar Feb 24 '24 17:02 jdgamble555

It seems this fixed it for me:

https://stackoverflow.com/a/78049935/271450

J

jdgamble555 avatar Feb 24 '24 17:02 jdgamble555

Update your package manager npm install -g npm@latest

Clear the cache npm cache clean -f

Then Terminate batch job and run again npm run dev

or

npm run start

PatrickJS avatar May 07 '24 04:05 PatrickJS