Schniz / fnm

🚀 Fast and simple Node.js version manager, built in Rust
https://fnm.vercel.app
GNU General Public License v3.0
18.47k stars 475 forks source link

How to use Node.js managed by fnm outside the terminal #1042

Open PinkChampagne17 opened 1 year ago

PinkChampagne17 commented 1 year ago

For example, I use a Git GUI to commit, the Git hooks I used are written by Node.js, and then an error occurs:

env: node: No such file or directory
husky - commit-msg hook exited with code 127 (error)
husky - command not found in PATH=....
lombervid commented 1 year ago

I suppose you would have to add the location of the node installation to the PATH. But I think that might break fnm version management.

nemchik commented 4 months ago

Potential workaround/solution https://github.com/Schniz/fnm/issues/668#issuecomment-2233615946

hellorayza commented 2 weeks ago

@nemchik Hi, to minimize disturbing more people, I'd like to inquire about my issue here.

I may understood the reasons why some commands in the husky hook don't work and the methods to address them,

https://typicode.github.io/husky/how-to.html#startup-files https://typicode.github.io/husky/how-to.html#node-version-managers-and-guis

but after trying the solutions you provided, I still receive errors indicating that fnm and npx are not recognized. This has been troubling me.