didyoumean2
didyoumean2 copied to clipboard
`npm install` fails when using npm version `10.4.0`
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
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",
I use an older version of npm and it works.