typicode / husky

Git hooks made easy 🐶 woof!
https://typicode.github.io/husky
MIT License
31.68k stars 996 forks source link

corepack - pnpm `command not found` #1425

Closed MartinX3 closed 2 weeks ago

MartinX3 commented 3 weeks ago

Arch Linux IntelliJ IDE

I installed pnpm via corepack enable. I restarted the system.

On commit it tells me command not found while using pnpm in pre-commit because it isn't in PATH used by husky, But if I look in the terminal it's inside PATH.

I manually added the pnpm part of my .bashrc (added by corepack) to the husky bash script in the .husky folder to make it work. I wonder why the PATH is different between husky and my system. Does husky ignore my .bashrc?

kaaax0815 commented 2 weeks ago

I have the same problem but on windows. What did you add to your script?

MartinX3 commented 2 weeks ago

@kaaax0815 it seems that problem is linux only and only dedicated to the IntelliJ IDEA. They have now an open issue ticket about not using the .bashrc if started via the desktop ui. Starting it via the terminal works fine.

kaaax0815 commented 2 weeks ago

I have a similar problem on windows and vscode. Using it via terminal also fixes the problem

MartinX3 commented 2 weeks ago

I think you need to open an issue ticket at vscode not using the user set path environmental changes if startet via the windows GUI.