You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npx husky init is generating this invalid pre-commit script:
npm
See bin.js: w('.husky/pre-commit', p.env.npm_config_user_agent?.split('/')[0] ?? 'npm' + ' test\n')
So possible values are either:
npm
npm test
On my mac:
p.env.npm_config_user_agent == 'npm/10.2.4 node/v20.11.1 darwin arm64 workspaces/false'
Order of operations error: + is higher than null coalesce. Looks like ?? was introduced in v9.1.0. Needs parens.
Easy problem to fix on new scripts, but confuses people following the documentation.
npx husky init
is generating this invalid pre-commit script:npm
See bin.js:
w('.husky/pre-commit', p.env.npm_config_user_agent?.split('/')[0] ?? 'npm' + ' test\n')
So possible values are either:
On my mac:
p.env.npm_config_user_agent == 'npm/10.2.4 node/v20.11.1 darwin arm64 workspaces/false'
Order of operations error: + is higher than null coalesce. Looks like ?? was introduced in v9.1.0. Needs parens.
Easy problem to fix on new scripts, but confuses people following the documentation.
Troubleshoot
https://typicode.github.io/husky/troubleshoot.html
If you're migrating from husky 4, see:
https://typicode.github.io/husky/migrate-from-v4.html
Context
Please describe your issue and provide some context:
Thank you!
The text was updated successfully, but these errors were encountered: