-
Notifications
You must be signed in to change notification settings - Fork 495
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
Feature Request: Automatically add the current default nodejs version to the PATH variable in windows. #733
Comments
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:
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. |
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. :) |
get same problem in Git hooks
|
This will be a problem for any GUI application that ends up invoking Node.js and is not started from a shell with fnm activated, e.g. Visual Studio. Would be cool to have a way to handle that cleanly... |
friendly reminder than in scripts you can do i have ideas on how to solve that. would not solve all issues, but node etc will certainly work. but... no time: i have family, work, and other side projects. if one of you have ideas on how to solve this and can put some effort and time (after describing their idea and getting |
Tried that. But I hit #1054. And in my case this is some command embedded inside some other project which needs to work for users who install Node.js in other ways. |
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.
The text was updated successfully, but these errors were encountered: