fnm
fnm copied to clipboard
Feature Request: Automatically add the current default nodejs version to the PATH variable in windows.
Although we can simply add fnm execution script into the powershell, but since its not available in the path directory, we can not use it during other process, for example, git bash
, git hooks. And have to do weird hooks in order to make fnm work there.
I don't think it will be that difficult to add both fnm, the current default node js version and default npm version into the path.
https://github.com/coreybutler/nvm-windows/blob/5803c4f8c7766c670996fbce3fc113a9b0d95050/src/nvm.go#L516
The nvm-windows is trying to do something like that here.
I had a similar problem, especially with the Git Hooks. My solution for this was to add the symlink folder for the default alias to the PATH environment variable in Windows:
C:\Users\my-username\.fnm\aliases\default
That way, in an environment where fnm is not set up, like git hooks , or git bash in your case, the default node and npm versions are available. And when fnm is set up, it will override the PATH according to the fnm setup.
You can do this with any alias you like, of course. Doesnt have to be the default.
Hope this helps.
I can do that, but my point was to make it a automatic feature into the FNM, i should have rephrased my sentence.
I can do that, but my point was to make it a automatic feature into the FNM, i should have rephrased my sentence.
Sure that would be nice to have, but in the meantime i just wanted to leave this workaround here so that people with similar problems don't have to struggle as much as I did. :)
this Feature Request is good idea!
in now I can`t use node in systemctl;
i need this feature ...
get same problem in Git hooks
.git/hooks/pre-commit: line 14: node: command not found