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

Installing Sharp Module with Error #57

Open
MarkSky opened this issue Jan 15, 2025 · 2 comments
Open

Installing Sharp Module with Error #57

MarkSky opened this issue Jan 15, 2025 · 2 comments

Comments

@MarkSky
Copy link

MarkSky commented Jan 15, 2025

After I upodated PNPM to version 10, I run the script and got errors:

PWA v0.21.1
WARNING: you must install the following dev dependencies to use the PWA assets generator:
- "@vite-pwa/assets-generator"
- "sharp" (should be installed when installing @vite-pwa/assets-generator)
- "sharp-ico" (should be installed when installing @vite-pwa/assets-generator) Error:
Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-win32-x64.node'
Require stack:
- C:\web\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\sharp.js
- C:\web\node_modules\.pnpm\[email protected]\node_modules\sharp\lib\constructor.js
- C:\web\node_modules\.pnpm\[email protected]\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 win32-x64 runtime: "npm install --platform=win32 --arch=x64 sharp"
- Consult the installation documentation: https://sharp.pixelplumbing.com/install
@userquin
Copy link
Member

Did you try installing the win32 version dev dep? You can use pinned versions for sharp and sharp ico.

@MarkSky
Copy link
Author

MarkSky commented Jan 16, 2025

I also try to add this code to package.json:

"pnpm": {
        "supportedArchitectures": {
            "os": [
                "window",
                "win32",
                "darwin",
                "current"
            ],
            "cpu": [
                "x64",
                "arm64"
            ]
        }
    },

But there is the same error.

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

2 participants