Skip to content

husky init not working #1334

@sinbino

Description

@sinbino

I am using docker node:20-slim image (debian 12.4, node 20.11.0, pnpm 8.14.3).
I get an error when I follow the get started procedure.
The version of husky is 9.0.1

pnpm add --save-dev husky
pnpm exec husky init

node:internal/fs/utils:699
    throw new ERR_INVALID_ARG_TYPE(propName, ['string', 'Buffer', 'URL'], path);
          ^

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
    at Object.openSync (node:fs:579:10)
    at Object.readFileSync (node:fs:457:35)
    at file:///home/node/app/node_modules/.pnpm/husky@9.0.1/node_modules/husky/bin.js:9:24
    at ModuleJob.run (node:internal/modules/esm/module_job:218:25)
    at async ModuleLoader.import (node:internal/modules/esm/loader:329:24)
    at async loadESM (node:internal/process/esm_loader:28:7)
    at async handleMainPromise (node:internal/modules/run_main:113:12) {
  code: 'ERR_INVALID_ARG_TYPE'
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions