unfolding-io / nebulix

Nebulix, a Fast & Green Theme Based on Astro + Static CMS + Snipcart
https://nebulix.unfolding.io/
Other
230 stars 111 forks source link

Something went wrong installing the "sharp" module #16

Closed lekiq closed 10 months ago

lekiq commented 10 months ago

I am using a Macbook Pro with a M2 chip, and I am getting this issue when running npm run dev

/Users/lekiq/opensource/nebulix/node_modules/astro-compress/node_modules/sharp/lib/sharp.js:37
  throw new Error(help.join('\n'));
        ^

Error: 
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-darwin-arm64v8.node'
Require stack:
- /Users/lekiq/opensource/nebulix/node_modules/astro-compress/node_modules/sharp/lib/sharp.js
- /Users/lekiq/opensource/nebulix/node_modules/astro-compress/node_modules/sharp/lib/constructor.js
- /Users/lekiq/opensource/nebulix/node_modules/astro-compress/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> (/Users/lekiq/opensource/nebulix/node_modules/astro-compress/node_modules/sharp/lib/sharp.js:37: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> (/Users/lekiq/opensource/nebulix/node_modules/astro-compress/node_modules/sharp/lib/constructor.js:11:1)
    at Module._compile (node:internal/modules/cjs/loader:1256:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)

Node.js v18.18.2
preetamslot commented 10 months ago

Hi, @lekiq. It looks like this is an error with astro-compress + m2 :( https://github.com/astro-community/AstroCompress

a quick fix if it is not working on m2, is removing the package from the astro.config file. just remove the import and the integration.

let me know if this fix the error.

lekiq commented 10 months ago

Hi, @lekiq. It looks like this is an error with astro-compress + m2 :( https://github.com/astro-community/AstroCompress

a quick fix if it is not working on m2, is removing the package from the astro.config file. just remove the import and the integration.

let me know if this fix the error.

Hi @preetamslot,

The quick fix works. Even though I think we should create an issue in https://github.com/astro-community/AstroCompress