Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR [worker reload] [worker init] Could not load the "sharp" module using the win32-x64 runtime #158

Closed
cmcnicholas opened this issue Feb 5, 2024 · 3 comments

Comments

@cmcnicholas
Copy link

Using og-image (as part of @nuxtseo/module) and I get the following when running nuxt dev, however build etc. work fine locally (and on CI).

Node Version: v20.11.0
OS: Windows 10

 ERROR  [worker reload] [worker init] Could not load the "sharp" module using the win32-x64 runtime                                                                         15:40:58  
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

  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> (D:\xxx\node_modules\sharp\lib\sharp.js:114:9)
  at Module._compile (node:internal/modules/cjs/loader:1376:14)
  at Module.load (node:internal/modules/cjs/loader:1207:32)
  at Module._load (node:internal/modules/cjs/loader:1023:12)
  at Module.require (node:internal/modules/cjs/loader:1235:19)
  at require (node:internal/modules/helpers:176:18)
  at Object.<anonymous> (D:\xxx\node_modules\sharp\lib\constructor.js:10:1)
  at Module._compile (node:internal/modules/cjs/loader:1376:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)

I have tried as suggested:

  1. npm install --include=optional sharp
  2. Tried specifying vite: { build: { rollupOptions: { external: ['sharp'] } } }
  3. Deleted node_modules and package lock then npm install
  4. Updated node version to LTS
@harlan-zw
Copy link
Collaborator

Hi, please migrate to @nuxtjs/seo package over @nuxtseo/module, it will be deprecated

@StevenJPx2
Copy link

This error shows up for me as well, I use @nuxtjs/seo.

 ERROR  [worker reload] [worker init]                                                                                                                                                                                                                              5:08:49 PM
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-darwin-arm64v8.node'
Require stack:
- /Users/stevenjohn/Documents/Hyphen/otherlands-website/node_modules/sharp/lib/sharp.js
- /Users/stevenjohn/Documents/Hyphen/otherlands-website/node_modules/sharp/lib/constructor.js
- /Users/stevenjohn/Documents/Hyphen/otherlands-website/node_modules/sharp/lib/index.js

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current darwin-arm64v8 runtime: "npm install --platform=darwin --arch=arm64v8 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install

  Something went wrong installing the "sharp" module

  Cannot find module '../build/Release/sharp-darwin-arm64v8.node'
  Require stack:
  - node_modules/sharp/lib/sharp.js
  - node_modules/sharp/lib/constructor.js
  - node_modules/sharp/lib/index.js

  Possible solutions:
  - Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
  - Install for the current darwin-arm64v8 runtime: "npm install --platform=darwin --arch=arm64v8 sharp"
  - Consult the installation documentation: https://sharp.pixelplumbing.com/install
  at Object.<anonymous> (node_modules/sharp/lib/sharp.js:37:9)
  at Module._compile (node:internal/modules/cjs/loader:1376:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
  at Module.load (node:internal/modules/cjs/loader:1207:32)
  at Module._load (node:internal/modules/cjs/loader:1023:12)
  at Module.require (node:internal/modules/cjs/loader:1235:19)
  at require (node:internal/modules/helpers:176:18)
  at Object.<anonymous> (node_modules/sharp/lib/constructor.js:11:1)
  at Module._compile (node:internal/modules/cjs/loader:1376:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)

@harlan-zw
Copy link
Collaborator

This should be fixed in latest RCs

@harlan-zw harlan-zw closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants