husky: V9 doesn't work after install
Basically what I did:
npm install --save-dev husky
and then:
npx husky init
file:///Users/.../project/node_modules/husky/bin.js:10
  ;(d.scripts ||= {}).prepare = 'husky'
              ^^^
SyntaxError: Unexpected token '||='
    at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18)
    at async link (internal/modules/esm/module_job.js:67:21)
Troubleshoot
- Before creating an issue, please check: 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
- OS X, normal OSX terminal
 
About this issue
- Original URL
 - State: closed
 - Created 5 months ago
 - Reactions: 3
 - Comments: 15 (7 by maintainers)
 
Commits related to this issue
- Fix #1366 Update how-to.md Fix #1366 by adding documentation to `how-to.md` — committed to gcko/husky by gcko 5 months ago
 - fix #1366 Update how-to.md (#1384) Fix #1366 by adding documentation to `how-to.md` — committed to e-ntro-py/husky by gcko 5 months ago
 
And thanks for the details, I’m still not sure why there’s a syntax error
Replace it with
husky. No need for npx orinstallanymore