Describe the bug
Hi Axios contributors,
While installing axios@1.9.0 as a transitive dependency in a monorepo, I’m encountering this error:
npm error .git can't be found
npm error > axios@1.9.0 prepare:hooks
npm error > npx husky set .husky/commit-msg "npx commitlint --edit $1"
npm error husky - install command is DEPRECATED
This appears to be caused by a prepare script in package.json that looks like this:
"scripts": { "prepare": "husky install && npm run prepare:hooks", "prepare:hooks": "npx husky set .husky/commit-msg \"npx commitlint --edit $1\"" }
This usage of husky in a published npm package breaks installation for consumers:
• It assumes a .git directory exists (which is not always true in monorepos or CI)
• It uses deprecated Husky commands (install, set)
• It runs developer-only tooling during install
Please consider removing the prepare script from the published package and move hook setup to a local-only husky:init script for contributors, e.g.:
"scripts": { "husky:init": "npx husky install && npx husky set .husky/commit-msg 'npx commitlint --edit $1'" }
To Reproduce
- go into a monorepo
- install a package that wants axios 1.9.0 as a resolution or dependencie
Code snippet
Expected behavior
should install as a transitive dependency in a monorepo
Axios Version
1.9.0
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
Additional Library Versions
Additional context/Screenshots
Describe the bug
Hi Axios contributors,
While installing axios@1.9.0 as a transitive dependency in a monorepo, I’m encountering this error:
This appears to be caused by a prepare script in package.json that looks like this:
"scripts": { "prepare": "husky install && npm run prepare:hooks", "prepare:hooks": "npx husky set .husky/commit-msg \"npx commitlint --edit $1\"" }This usage of husky in a published npm package breaks installation for consumers:
• It assumes a .git directory exists (which is not always true in monorepos or CI)
• It uses deprecated Husky commands (install, set)
• It runs developer-only tooling during install
Please consider removing the prepare script from the published package and move hook setup to a local-only husky:init script for contributors, e.g.:
"scripts": { "husky:init": "npx husky install && npx husky set .husky/commit-msg 'npx commitlint --edit $1'" }To Reproduce
Code snippet
Expected behavior
should install as a transitive dependency in a monorepo
Axios Version
1.9.0
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
Additional Library Versions
Additional context/Screenshots