onwidget / astrowind

⭕️ AstroWind: A free template using Astro 4.0 and Tailwind CSS. Astro starter theme.
https://astrowind.vercel.app
MIT License
3.57k stars 1.09k forks source link

Issue with peer dependencies : unmet peer sharp@^0.31.3: found 0.32.0 #156

Closed lionelhorn closed 1 year ago

lionelhorn commented 1 year ago

Dev script fails to start. After git clone from https://github.com/onwidget/astrowind/tree/8db176fe924f50fa84bfc31c09e6150a5dde71de pnpm install, pnpm run dev

Windows 10.0.22621 node 18.15.0 pnpm 8.0.0

Setting sharp to 0.31.3 instead of 0.32.0 fixes the issue.

See log below.


PS C:\PROG\_bug-repros> git clone https://github.com/onwidget/astrowind repro-astrowind
Cloning into 'repro-astrowind'...
remote: Enumerating objects: 4408, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4408 (delta 0), reused 1 (delta 0), pack-reused 4405
Receiving objects: 100% (4408/4408), 11.05 MiB | 4.92 MiB/s, done.
Resolving deltas: 100% (2558/2558), done.

PS C:\PROG\_bug-repros> cd .\repro-astrowind\

PS C:\PROG\_bug-repros\repro-astrowind> pnpm install
 WARN  deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
Packages: +784
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: C:\Users\Lionel\AppData\Local\pnpm\store\v3
  Virtual store is at:             node_modules/.pnpm
Progress: resolved 806, reused 784, downloaded 0, added 784, done
node_modules/.pnpm/nodejieba@2.5.2/node_modules/nodejieba: Running install script, failed in 5.3s (skipped as optional)
node_modules/.pnpm/esbuild@0.17.14/node_modules/esbuild: Running postinstall script, done in 506ms

devDependencies:
+ @astrojs/image 0.16.2 (0.16.3 is available)
+ @astrojs/mdx 0.18.2
+ @astrojs/partytown 1.1.1 (1.2.0 is available)
+ @astrojs/rss 2.3.1
+ @astrojs/sitemap 1.2.1
+ @astrojs/tailwind 3.1.1
+ @astrolib/analytics 0.3.0
+ @astrolib/seo 0.3.0
+ @fontsource/inter 4.5.15
+ @tailwindcss/typography 0.5.9
+ @typescript-eslint/eslint-plugin 5.57.0
+ @typescript-eslint/parser 5.57.0
+ astro 2.1.7 (2.1.8 is available)
+ astro-compress 1.1.35
+ astro-icon 0.8.0
+ eslint 8.36.0 (8.37.0 is available)
+ eslint-plugin-astro 0.26.1
+ eslint-plugin-jsx-a11y 6.7.1
+ limax 2.1.0 (4.0.0 is available)
+ mdast-util-to-string 3.1.1
+ prettier 2.8.7
+ prettier-plugin-astro 0.8.0
+ reading-time 1.5.0
+ sharp 0.32.0
+ svgo 2.8.0 (3.0.2 is available)
+ tailwindcss 3.2.7 (3.3.0 is available)
+ typescript 5.0.2

 WARN  Issues with peer dependencies found
.
└─┬ astro 2.1.7
  └── ✕ unmet peer sharp@^0.31.3: found 0.32.0

The integrity of 5901 files was checked. This might have caused installation to take longer.
Done in 37.6s

PS C:\PROG\_bug-repros\repro-astrowind> pnpm run dev

> @onwidget/astrowind@0.9.8 dev C:\PROG\_bug-repros\repro-astrowind
> astro dev

node:internal/process/promises:288
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error:
Something went wrong installing the "sharp" module

The specified procedure could not be found.
\\?\C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\sharp@0.32.0\node_modules\sharp\build\Release\sharp-win32-x64.node

Possible solutions:
- Install with verbose logging and look for errors: "npm install --ignore-scripts=false --foreground-scripts --verbose sharp"
- Install for the current win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
- Ensure the version of sharp aligns with the .pnpm package: "npm ls sharp"
    at Object.<anonymous> (C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\sharp@0.32.0\node_modules\sharp\lib\sharp.js:37:9)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Module.require (node:internal/modules/cjs/loader:1141:19)
    at require (node:internal/modules/cjs/helpers:110:18)
    at Object.<anonymous> (C:\PROG\_bug-repros\repro-astrowind\node_modules\.pnpm\sharp@0.32.0\node_modules\sharp\lib\constructor.js:11:1)
    at Module._compile (node:internal/modules/cjs/loader:1254:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10) {
  plugin: undefined,
  hint: 'Browser APIs are not available on the server.\n' +
    '\n' +
    'If the code is in a framework component, try to access these objects after rendering using lifecycle methods or use a `client:only` directive to make the component exclusively run on the client.\n' +
    '\n' +
    'See https://docs.astro.build/en/guides/troubleshooting/#document-or-window-is-not-defined for more information.\n' +
    '\t\t'
}```

Node.js v18.15.0
 ELIFECYCLE  Command failed with exit code 1.
prototypa commented 1 year ago

Hello @lionelhorn

Thank you so much. It has been resolved: https://github.com/onwidget/astrowind/commit/f3d97335282a8f8219d3523675b5d16fcb49df3b