strapi / blocks-react-renderer

A React renderer for the Strapi's Blocks rich text editor
Other
107 stars 15 forks source link

[bug]: Can't install blocks-react-renderer package if husky isn't installed #40

Open vsimonovski opened 2 weeks ago

vsimonovski commented 2 weeks ago

What version of @strapi/blocks-react-renderer are you using?

What's Wrong?

Once I do npm install @strapi/blocks-react-renderer react react-dom command inside FE project that doesn't have husky installed as a dependency I get the following error:

npm install @strapi/blocks-react-renderer react react-dom
npm ERR! code 127
npm ERR! path <PATH_TO_THE_FE_PROJECT>/node_modules/@strapi/blocks-react-renderer
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! sh: husky: command not found

npm ERR! A complete log of this run can be found in: <PATH_TO_THE_LOG>

If I do npm install husky --save-dev and run npm install @strapi/blocks-react-renderer react react-dom command again everything is installed correctly.

To Reproduce

Create a new project with vite: npm create vite@latest demo-project --template react-ts

Navigate to the project directory: cd demo-project

Run npm install: npm install

Try to install @strapi/blocks-react-renderer: npm install @strapi/blocks-react-renderer react react-dom

Expected Behaviour

@strapi/blocks-react-renderer should be installed without having husky as a dev dependency

MohammedAlez commented 2 weeks ago

I faced this issue yesterday, try to do these: 1- Open your terminal and run: npm install -g husky 2- Navigate to your project directory and run: npm install husky --save-dev 3- try again to install the command: npm install @strapi/blocks-react-renderer

vsimonovski commented 2 weeks ago

I faced this issue yesterday, try to do these:

1- Open your terminal and run: npm install -g husky

2- Navigate to your project directory and run: npm install husky --save-dev

3- try again to install the command: npm install @strapi/blocks-react-renderer

Yes, I've included that information in my report although the step for installing the husky globally isn't necessary, it's enough to install the husky as a dev dep.