VSCode git "npm command not found"

91 Views Asked by At

I have a precommit hook with this content

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run lint

This hook runs whenever I try to commit changes.

For a few days now, I get the error "npm command not found" every time I try to commit directly in VS Code's source control box but not when I manually run the git commit command in the integrated terminal.

For context, I use ZSH as the default terminal on my Mac and use NVM for managing node versions between projects.

0

There are 0 best solutions below