Open
Description
I'm using husky
globally. It's installed in /usr/lib/node_modules/husky
, binary is /usr/bin/husky
.
Doing:
cd ~/
husky init
Leads to:
node:fs:563
return binding.open(
^
Error: ENOENT: no such file or directory, open 'package.json'
at Object.openSync (node:fs:563:18)
at Object.readFileSync (node:fs:447:35)
at file:///usr/lib/node_modules/husky/bin.js:12:8
at ModuleJob.run (node:internal/modules/esm/module_job:272:25)
at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:583:26)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5) {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'package.json'
}
Node.js v23.8.0
Does husky
only work in directories that contain a package.json
? Can husky
not be configured globally and should a user only use it in a .git
directory-containing git repository? I can't tell if the above unhandled error is because of user-error or because of a bug.
Metadata
Assignees
Labels
No labels
Activity