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

Compatibility with npm --ignore-scripts #39

Open
anderskiaer opened this issue Mar 1, 2024 · 1 comment
Open

Compatibility with npm --ignore-scripts #39

anderskiaer opened this issue Mar 1, 2024 · 1 comment

Comments

@anderskiaer
Copy link

If using the security best practice with ignore-scripts (either through --ignore-scripts npm CLI flag, or in .npmrc), the asset generator fails with:

transforming (1) index.html
PWA v0.19.0
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-linux-x64.node'

This looks to be related to usage of --ignore-scripts. Not seen any other packages in vite ecosystem that requires the ability of running install/post-install scripts, so if the above analysis is correct, should this requirement (possibility to run install scripts) be mentioned in the docs? 🙂


@anderskiaer
Copy link
Author

Looks like this problem solves itself when updating sharp dependency (lovell/sharp#3750 (comment)). I.e. #38 also solves this issue.

@anderskiaer anderskiaer changed the title Not compatible with npm --ignore-scripts Compatibility with npm --ignore-scripts Mar 5, 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

1 participant