Open petross3530mx opened 3 months ago
same problem
Hi dear contributors!
I have some problems with this line of code.
The main problem happened when running typical build command ( for example in nextjs, for example in docker, some pipelines ) , for which dependencies under "dependencies" block typically is required, but devDependencies should be is not required (omit=dev) So husky is not installed for omit=dev, but docker tried to run postinstall command and pipeline failing
So there are a some possible solutions:
- Add condition to postinstall script to run husky only if it installed "scripts": { "postinstall": "if [ -d node_modules/husky ]; then husky install; fi" }
- Using prepare script for husky, which will be automatically called before npm publish "scripts": { "prepare": "husky install" }
- Install all the dependencies using npm install (without omit dev). Is not the best practice as devDependencies will be installed for builld
- Add husky to dependencies package json section which can be ok only as fast temporary fix
you saved my life!!!
I have this problem when simply installing the package (not in a pipeline or during a build command). See #34 for steps to reproduce.
I have the same issue, I had a React project where I test things out, I wanted to test this package, and upon installation I got the following error
$ npm i @strapi/blocks-react-renderer
npm ERR! code 1
npm ERR! path <some-path>\react-typescript-playground\node_modules\@strapi\blocks-react-renderer
npm ERR! command failed
npm ERR! command C:\Windows\system32\cmd.exe /d /s /c husky install
npm ERR! 'husky' is not recognized as an internal or external command,
npm ERR! operable program or batch file.
npm ERR! A complete log of this run can be found in: <some-path>\AppData\Local\npm-cache\_logs\2024-05-12T13_40_31_534Z-debug-0.log
I am using Windows 10, nvm 1.1.12, node 20.11.1, npm 10.4.0
how to resolve this ? I am stuck on this tried adding husky under dependencies
have the same issue in developing mode
Same issue while installing the package. Thanks.
using pnpm for now instead of npm, seems to be working fine
Hi dear contributors!
I have some problems with this line of code. https://github.com/strapi/blocks-react-renderer/blob/4c6faf1d62f5c513545e4150e1b02170660c289e/package.json#L47
The main problem happened when running typical build command ( for example in nextjs, for example in docker, some pipelines ) , for which dependencies under "dependencies" block typically is required, but devDependencies should be is not required (omit=dev) So husky is not installed for omit=dev, but docker tried to run postinstall command and pipeline failing
So there are a some possible solutions:
Add condition to postinstall script to run husky only if it installed "scripts": { "postinstall": "if [ -d node_modules/husky ]; then husky install; fi" }
Using prepare script for husky, which will be automatically called before npm publish "scripts": { "prepare": "husky install" }
Install all the dependencies using npm install (without omit dev). Is not the best practice as devDependencies will be installed for builld
Add husky to dependencies package json section which can be ok only as fast temporary fix