Nvm-windows: Error when issuing 'nvm use' command in git-bash terminal

Created on 25 Jan 2016  路  8Comments  路  Source: coreybutler/nvm-windows

When attempting to issue an _'nvm use '_, 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

Most helpful comment

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.

All 8 comments

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

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.

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.

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!).

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.

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

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!

I was able to resolve this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Pomax picture Pomax  路  3Comments

fredericrous picture fredericrous  路  3Comments

janpio picture janpio  路  3Comments

Deilan picture Deilan  路  4Comments

AllainPL picture AllainPL  路  7Comments