Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

husky init not working #1334

Closed
sinbino opened this issue Jan 25, 2024 · 6 comments
Closed

husky init not working #1334

sinbino opened this issue Jan 25, 2024 · 6 comments

Comments

@sinbino
Copy link

sinbino commented Jan 25, 2024

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'
}
@recallwei
Copy link

Same to me, It seems pnpm not working, I use npx instead.

@marcinincreo
Copy link

husky.sh file that init creates is empty when using npx

@ohroy
Copy link
Contributor

ohroy commented Jan 25, 2024

+1

@dmitriy-kudelko
Copy link

Same here

@artursudnik
Copy link

+1

ohroy pushed a commit to ohroy/husky that referenced this issue Jan 25, 2024
typicode added a commit that referenced this issue Jan 25, 2024
* fix: fix init not work on pnpm #1334

* doc: pnpm users must run init on project root

* Update bin.js

* Update bin.js

* Update get-started.md

---------

Co-authored-by: 键来! <jmpecx@outlook.com>
Co-authored-by: typicode <typicode@gmail.com>
@typicode
Copy link
Owner

It should be good now

gisbdzhch pushed a commit to gisktzh/gb3-web_ui that referenced this issue Jan 31, 2024
This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [husky](https://github.com/typicode/husky) | [`^8.0.1` -> `^9.0.0`](https://renovatebot.com/diffs/npm/husky/8.0.3/9.0.6) | [![age](https://developer.mend.io/api/mc/badges/age/npm/husky/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/husky/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/husky/8.0.3/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/husky/8.0.3/9.0.6?slim=true)](https://docs.renovatebot.com/merge-confidence/) |

---

### Release Notes

<details>
<summary>typicode/husky (husky)</summary>

### [`v9.0.6`](https://github.com/typicode/husky/releases/tag/v9.0.6)

[Compare Source](typicode/husky@v9.0.5...v9.0.6)

-   docs: add favicon by [@&#8203;rakleed](https://github.com/rakleed) in typicode/husky#1354
-   chore: apply editorconfig to code only by [@&#8203;typicode](https://github.com/typicode) in typicode/husky#1355
-   docs: update install script to mjs and fix CI checks by [@&#8203;starnayuta](https://github.com/starnayuta) in typicode/husky#1357
-   Fix  unbound variable by [@&#8203;typicode](https://github.com/typicode) in typicode/husky#1359

### [`v9.0.5`](https://github.com/typicode/husky/releases/tag/v9.0.5)

[Compare Source](typicode/husky@v9.0.4...v9.0.5)

-   docs: update path to startup files by [@&#8203;ManuelRauber](https://github.com/ManuelRauber) in typicode/husky#1350
-   fix: init error by [@&#8203;typicode](https://github.com/typicode) in typicode/husky#1353

### [`v9.0.4`](https://github.com/typicode/husky/releases/tag/v9.0.4)

[Compare Source](typicode/husky@v9.0.3...v9.0.4)

-   fix: init create dir before by [@&#8203;typicode](https://github.com/typicode) in typicode/husky#1348
-   refactor: simplify by [@&#8203;typicode](https://github.com/typicode) in typicode/husky#1349
-   fix: init not working on pnpm [#&#8203;1334](typicode/husky#1334) by [@&#8203;rozbo](https://github.com/rozbo) in typicode/husky#1347

### [`v9.0.3`](https://github.com/typicode/husky/releases/tag/v9.0.3)

[Compare Source](typicode/husky@v9.0.2...v9.0.3)

-   docs: fix link by [@&#8203;typicode](https://github.com/typicode) in typicode/husky#1340
-   chore: fix links in issue template by [@&#8203;julien-f](https://github.com/julien-f) in typicode/husky#1341
-   fi...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants