didyoumean2 icon indicating copy to clipboard operation
didyoumean2 copied to clipboard

`npm install` fails when using npm version `10.4.0`

Open kjots opened this issue 5 months ago • 1 comments

Installation fails when installing with npm version 10.4.0. The npm install command runs the postinstall script, which attempts to run husky but fails as this is not listed as a package dependency. This does not occur when using npm version 10.3.0.

Output when using npm 10.3.0:

$ npm --version
10.3.0
$ npm install [email protected]

added 5 packages, and audited 6 packages in 3s

found 0 vulnerabilities

Output when using npm 10.4.0:

$ npm --version
10.4.0
$ npm install [email protected]
npm ERR! code 127
npm ERR! path /home/kjots/Development/Projects/didyoumean2-postinstall-issue/node_modules/didyoumean2
npm ERR! command failed
npm ERR! command sh -c husky install
npm ERR! sh: 1: husky: not found

kjots avatar Feb 05 '24 01:02 kjots

I think it is a bug from npm side. If you look into the package.json in build, the postinstall script has a _ prefix which should not run.

"_postinstall": "husky install",

foray1010 avatar Feb 05 '24 03:02 foray1010