Skip to content
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

Error when issuing 'nvm use' command in git-bash terminal #140

Closed
Daren-J-Smith opened this issue Jan 25, 2016 · 9 comments
Closed

Error when issuing 'nvm use' command in git-bash terminal #140

Daren-J-Smith opened this issue Jan 25, 2016 · 9 comments

Comments

@Daren-J-Smith
Copy link

When attempting to issue an 'nvm use <installed.version>', an error is issued due to a program association in windows. I have tried to associate .cmd files with git-bash, but the error is still present. I will perform some additional troubleshooting and see if the error can be worked around. The git version being used is git version 2.7.0.windows.1

image
image

@coreybutler
Copy link
Owner

Make sure the mklink function is available in git-bash. NVM uses this command to manage which version of node to use.

@Daren-J-Smith
Copy link
Author

That makes sense. I'll look into mklink in git-bash, it probably conflicts with ln that is part of the git distro for Windows.

@caffeinewriter
Copy link

I've been experiencing this as well. As a workaround, I just open up a normal cmd window, and then run nvm use from that. I'm also attempting to see if I can find a way to have mklink usable in git-bash.

@coreybutler
Copy link
Owner

I'm closing this due to a) age and b) because I think the issue has to do with mklink compatibility. And I guess c) git-bash is it's own shell and I can't support every custom shell (PR's totally welcome though!).

@Daren-J-Smith
Copy link
Author

Thought I'd provide an update on this. I tested this again with git bash version 2.9.2 today and the mklink function is now working correctly, so nvm use can now be executed correctly from a git bash terminal. Thanks again for providing this tool. Invaluable to users that have to perform some development on the Windows platform.

@coreybutler
Copy link
Owner

Thanks for the update, and it's quite awesome this is working in the latest git bash shell!

@robertmirro
Copy link

Hi @Daren-J-Smith. What version of Windows are you running?

Also, did you choose the "Use Git from the Windows Command Prompt" option when installing Git 2.9.2?

I just installed NVM 1.1.1 on Win7 Pro 64-bit as per this comment but I get "command not found" when I attempt to run mklink from the 2.9.2.windows.1 bash shell:

RMirro ~
$ git --version
git version 2.9.2.windows.1

RMirro ~
$ mklink
bash: mklink: command not found

mklink is available when I use the windows command prompt (cmd):

C:\Users\rmirro>mklink
Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

        /D      Creates a directory symbolic link.  Default is a file
                symbolic link.
        /H      Creates a hard link instead of a symbolic link.
        /J      Creates a Directory Junction.
        Link    specifies the new symbolic link name.
        Target  specifies the path (relative or absolute) that the new link
                refers to.

Thanks!

@robertmirro
Copy link

I was able to resolve this issue.

@pumanitro
Copy link

pumanitro commented Jan 4, 2024

For me nvm install lts in the power shell made it work in git bash terminal. Mostly because I had no npm installed at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants