-
-
Notifications
You must be signed in to change notification settings - Fork 8k
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
git on windows can’t clone nvm test filenames #1643
Comments
What does |
Ah, you're on Windows - are you using BashOnWindows? What shell are you using? |
I have the same problem with zsh on BashOnWindows (WSL/Ubuntu from Windows Store, Windows 10 Fall Creators Update). I'm not able to install nvm, nor to checkout a previous commit since this test is automatically starting (and failing). |
I'm confused; BashOnWindows is bash - you can run zsh on windows? @lamuertepeluda same question for you :-) |
@ljharb here's the output $ type git
git is /usr/bin/git
$ git --version
git version 2.7.4 And yes, now you can use the shell you prefer on WSL (Windows Subsystem for Linux), and I opted for zsh + oh-my-zsh since they increase my productivity a lot on my Mac and Linux setups. In case you are interested, I followed these two interesting guides:
I am trying to get rid of git-bash, cygwin and nvm-windows which, although they are great softwares for what they aim to do, have some limitations. My hope is that WSL has a more "linuxish" experience since it's easier for me to deal with dev stuff on Linux. That said, this page and this other page say nvm is supported by WSL, using the standard way of installation with curl/wget. |
fwiw, omz breaks a ton of things :-/ it's the biggest cause of complexity in nvm.
This specific issue, however, appears to be some kind of incompatibility with the git clone operation performed by the install script. Can you try git cloning this repo directly on the command line? What happens if you check out the master branch, or the latest git tag? |
I tried that and I get the same error. It seems like a git hook is fired right after cloning the repository and fails. |
Git hooks only exist when locally installed; by default, there shouldn't be any git hooks. |
yes you are right, but I've got a lot of uncommited files right after cloning so that was my guess... Anyway this is the output after changing to bash ( $curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12492 100 12492 0 0 1995 0 0:00:06 0:00:06 --:--:-- 1995
=> Downloading nvm from git to '/home/vito/.nvm'
=> Cloning into '/home/vito/.nvm'...
remote: Counting objects: 263, done.
remote: Compressing objects: 100% (228/228), done.
remote: Total 263 (delta 31), reused 108 (delta 25), pack-reused 0
Receiving objects: 100% (263/263), 116.03 KiB | 15.00 KiB/s, done.
Resolving deltas: 100% (31/31), done.
Checking connectivity... done.
Note: checking out 'b546436113084d6de584c57b259b947dd467a900'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b <new-branch-name>
Checking out files: 100% (239/239), done.
=> Compressing and cleaning up git repository
=> Appending nvm source string to /home/vito/.bashrc
=> Appending bash_completion source string to /home/vito/.bashrc
net.js:201
this._handle.open(options.fd);
^
Error: EINVAL: invalid argument, uv_pipe_open
at new Socket (net.js:201:18)
at createWritableStdioStream (internal/process/stdio.js:173:16)
at process.getStdout [as stdout] (internal/process/stdio.js:20:14)
at console.js:243:37
at NativeModule.compile (bootstrap_node.js:614:7)
at Function.NativeModule.require (bootstrap_node.js:559:18)
at installInspectorConsole (bootstrap_node.js:339:41)
at get (bootstrap_node.js:330:13)
at startup (bootstrap_node.js:60:29)
at bootstrap_node.js:626:3
=> Close and reopen your terminal to start using nvm or run the following to use it now:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
And this happens when cloning: $git clone https:/creationix/nvm.git .nvm
Cloning into '.nvm'...
remote: Counting objects: 6598, done.
remote: Total 6598 (delta 0), reused 0 (delta 0), pack-reused 6598
Receiving objects: 100% (6598/6598), 2.01 MiB | 77.00 KiB/s, done.
Resolving deltas: 100% (4092/4092), done.
Checking connectivity... done.
error: unable to create file test/fast/Aliases/"nvm alias" should not accept aliases with slashes (No such file or directory)
error: unable to create file test/fast/Aliases/"nvm unalias" should not accept aliases with slashes (No such file or directory)
error: unable to create file test/fast/Aliases/Running "nvm alias <aliasname> <target>" again should change the target (No such file or directory)
error: unable to create file test/fast/Aliases/Running "nvm alias <aliasname>" should list but one alias. (No such file or directory)
error: unable to create file test/fast/Aliases/Running "nvm alias" lists implicit aliases when they do not exist (No such file or directory)
error: unable to create file test/fast/Aliases/Running "nvm alias" lists manual aliases instead of implicit aliases when present (No such file or directory)
error: unable to create file test/fast/Aliases/Running "nvm alias" should list all aliases. (No such file or directory)
error: unable to create file test/fast/Aliases/lts/"nvm alias" should ensure LTS alias dir exists (No such file or directory)
error: unable to create file test/fast/Listing paths/Running "nvm which 0.0.2" should display only version 0.0.2. (No such file or directory)
error: unable to create file test/fast/Listing paths/Running "nvm which foo" should return a nonzero exit code when not found (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls 0.0.2" should display only version 0.0.2. (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls 0.2" should display only 0.2.x versions. (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls foo" should return a nonzero exit code when not found (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls io" should return NA (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls node_" should return a nonzero exit code when not found (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls stable" and "nvm ls unstable" should return the appropriate implicit alias (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls system" should include "system" when appropriate (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls" should display all installed versions. (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls" should filter out ".nvm" (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls" should filter out "versions" (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls" should include "system" when appropriate (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls" should list versions in the "versions" directory (No such file or directory)
error: unable to create file test/fast/Listing versions/Running "nvm ls" with node-like versioning vx.x.x should only list a matched version (No such file or directory)
error: unable to create file test/fast/Running "nvm alias" should create a file in the alias directory. (No such file or directory)
error: unable to create file test/fast/Running "nvm current" should display current nvm environment. (No such file or directory)
error: unable to create file test/fast/Running "nvm deactivate" should unset the nvm environment variables. (No such file or directory)
error: unable to create file test/fast/Running "nvm install" with "--reinstall-packages-from" requires a valid version (No such file or directory)
error: unable to create file test/fast/Running "nvm install" with an invalid version fails nicely (No such file or directory)
error: unable to create file test/fast/Running "nvm unalias" should remove the alias file. (No such file or directory)
error: unable to create file test/fast/Running "nvm uninstall" should remove the appropriate directory. (No such file or directory)
error: unable to create file test/fast/Running "nvm uninstall" with incorrect file permissions fails nicely (No such file or directory)
error: unable to create file test/fast/Running "nvm unload" should unset all function and variables. (No such file or directory)
error: unable to create file test/fast/Running "nvm use foo" where "foo" is circular aborts (No such file or directory)
error: unable to create file test/fast/Running "nvm use iojs" uses latest io.js version (No such file or directory)
error: unable to create file test/fast/Running "nvm use system" should work as expected (No such file or directory)
error: unable to create file test/fast/Running "nvm use x" should create and change the "current" symlink (No such file or directory)
error: unable to create file test/fast/Running "nvm use x" should not create the "current" symlink if $NVM_SYMLINK_CURRENT is false (No such file or directory)
error: unable to create file test/slow/Running "nvm current" should display current nvm environment. (No such file or directory)
error: unable to create file test/slow/nvm exec/Preamble works and respects "silent" flag (No such file or directory)
error: unable to create file test/slow/nvm exec/Running "nvm exec --lts" should work (No such file or directory)
error: unable to create file test/slow/nvm exec/Running "nvm exec 0.x" should work (No such file or directory)
error: unable to create file test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version (No such file or directory)
error: unable to create file test/slow/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out (No such file or directory)
error: unable to create file test/slow/nvm run/Running "nvm run --harmony --version" should work (No such file or directory)
error: unable to create file test/slow/nvm run/Running "nvm run --lts" should work (No such file or directory)
error: unable to create file test/slow/nvm run/Running "nvm run 0.x" should error out sensibly when 0.x is not installed (No such file or directory)
error: unable to create file test/slow/nvm run/Running "nvm run 0.x" should work (No such file or directory)
error: unable to create file test/slow/nvm run/Running "nvm run" should pick up .nvmrc version (No such file or directory)
error: unable to create file test/slow/nvm uninstall/Running "nvm uninstall 0.12.6" uninstalls v0.12.6 (No such file or directory)
error: unable to create file test/slow/nvm uninstall/Running "nvm uninstall" with incorrect file permissions fails nicely (No such file or directory)
error: unable to create file test/slow/nvm use/Running "nvm use --lts" uses latest LTS version (No such file or directory)
error: unable to create file test/slow/nvm use/Running "nvm use --lts=foo" uses latest "foo" LTS version (No such file or directory)
error: unable to create file test/slow/nvm use/Running "nvm use iojs" uses latest io.js version (No such file or directory)
error: unable to create file test/slow/nvm use/Running "nvm use node" uses latest stable node version (No such file or directory)
error: unable to create file test/slow/nvm use/Running "nvm use v1.0.0" uses iojs-v1.0.0 iojs version (No such file or directory)
error: unable to create file test/slow/nvm use/Running "nvm use" calls "nvm_die_on_prefix" (No such file or directory)
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD' Attached you see the log of |
The only things that happen after "appending bash completion" and before "Close" is:
In general, this seems like |
yes @ljharb , I tried with bash but I get the same errors on zsh |
nvm repo has files with quotes in their filenames which is far from the best idea from compatibility standpoint. Looks like windows does support quotes in filenames but it likely requires |
If a windows git client chokes on perfectly valid filenames with quotes, then that git client is broken. @isomorphisms: what is |
Yes, the client is broken, and that doesn't make the experience of using nvm any better. |
I'm using git bash for windows and getting the same |
Try setting the core.autocrlf setting in your global git config. |
I am getting same issue. I tried playing with the core.autocrlf settings but no joy. Anyone have any other suggestions for a workaround? |
My solution is to use wsl bash shell to clone the nvm repo into the windows user .nvm dir and checkout the preferred git release. this bypasses the issue with the windows git client, by using a linux git client. |
This comment has been minimized.
This comment has been minimized.
I'm also getting this error:
I'm using Bash for Windows:
The problem is windows cant have Can these be renamed? The offending files can be seen in the following output:
|
@br3nt comments higher upthread suggest if you're using linux git inside WSL, it will work fine? |
As long as nvm still works fine on supported systems (BashOnWindows/WSL is included, using linux software only), then the filenames aren't troublesome, and I'd prefer not to rename files with perfectly valid names just because Windows has a broken filesystem. |
@ljharb but it doesn't work on Bash for Windows (it uses the windows file system whereas WSL uses a completely separate linux file system) The error in Bash for Windows is because the the windows file system doesn't accept the An example error message:
|
Maybe I'm confused; WSL and BashOnWindows aren't the same thing? If git supports a character in a filename, then either Windows, or git for windows, should handle it - perhaps it's not Windows that's broken, but git on windows. |
I think we're both talking about different things. I'm specifically talking about Git for Windows (also known as Git BASH) which can be downloaded from git-scm.com and gitforwindows.org. It is different from WSL. From this SO:
I can confirm I can clone the repo within WSL. But I can also confirm that I get an error (as posted above) when I clone using Git for Windows. |
I think it is a windows thing rather than a windows git thing because if you try to manually create a file with the same name as the ones mentioned in the error I posted in my comment above you get the following error message:
You physically cannot type those characters when renaming a file (eg when right clicking on a file and selecting rename or when creating a new file). Additionally, if you end the file name with a |
@ljharb, as a test, I have created a fork of the nvm repo and renamed all of the files with I am now able to successfully clone the fork with the filename changes in Git for Windows (aka Git BASH). I can confirm I was able to source |
The commits containing the renames in my fork are not in a state in which I can submit a pull request as I simply replaced those characters with an I'm happy to submit a pull request though if I get some direction as to what I should replace the characters with. |
What I'm saying is that the git for windows client should be quietly translating those non-Windows-compatible filenames into something that works on Windows (and changing them back as well). The definition for a working git client includes "supporting all kinds of filenames git itself supports".
With those three changes (of which I'm only content with the first two), what other issues would remain? |
As far as I can tell, they are the only changes that need to be made. |
nah the intention is to mirror bash command line argument conventions, for which a variable kind of matches the typical < > syntax |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The changes discussed above by @ljharb and myself is still on my radar/todo list... however my work priorities have changed for another few weeks. I will pick this up again once my priorities align again in the next few weeks. |
confirming that the issue is with windows filenames as mentioned: #1643 (comment) downloading a .zip from github https:/nvm-sh/nvm/archive/v0.35.3.zip and attempting to extract also results in errors this is also a workaround though as the problematic files can be skipped, and the other files are still successfully extracted (unlike with git checkout) |
Doesn’t windows use \ instead of /? Might be wrong, it has been a long time before I was on windows. |
@Yash-Singh1 it looks like the quotation marks |
One fix could be setting up an on-push or on-tag github action that deletes |
@dumptyd windows users using WSL and a linux version of git should be able to install it just fine; my understanding is that this is only an issue when installing/cloning on non-WSL, or when cloning for dev purposes. |
@ljharb I'm trying it install it in git bash (#1643 (comment), #1643 (comment)) so I don't have to use WSL as it's much heavier. |
@dumptyd nvm simply won’t work on git bash - nvm requires a posix shell, so on Windows, WSL is your only option. |
I was getting the first line error error: unable to create file test/fast/Aliases/"nvm alias" should not accept aliases with slashes: Invalid argument . After some research I gave up and dowloaded this .zip from this link https://content.breatheco.de/en/how-to/nvm-install-windows#:~:text=Install%20nvm%20Go%20to%20your,that%20you%20will%20hit%20too. Saludos! |
I believe this is fixed in #2397. |
Operating system and version:
windows 10
nvm debug
output:curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh | bash
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 12492 100 12492 0 0 10658 0 0:00:01 0:00:01 --:--:-- 10658
=> Downloading nvm from git to '/c/Users/CJ/.nvm'
=> Cloning into 'C:/Users/CJ/.nvm'...
remote: Counting objects: 263, done.
remote: Compressing objects: 100% (228/228), done.
remote: Total 263 (delta 31), reused 108 (delta 25), pack-reused 0 eceivin
Receiving objects: 100% (263/263), 116.01 KiB | 2.97 MiB/s, done.
Resolving deltas: 100% (31/31), done.
Note: checking out 'b546436113084d6de584c57b259b947dd467a900'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
error: unable to create file test/fast/Aliases/"nvm alias" should not accept aliases with slashes: Invalid argument
error: unable to create file test/fast/Aliases/"nvm unalias" should not accept aliases with slashes: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias " again should change the target: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias " should list but one alias.: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias" lists implicit aliases when they do not exist: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias" lists manual aliases instead of implicit aliases when present: Invalid argument
error: unable to create file test/fast/Aliases/Running "nvm alias" should list all aliases.: Invalid argument
error: unable to create file test/fast/Aliases/lts/"nvm alias" should ensure LTS alias dir exists: Invalid argument
error: unable to create file test/fast/Listing paths/Running "nvm which 0.0.2" should display only version 0.0.2.: Invalid argument
error: unable to create file test/fast/Listing paths/Running "nvm which foo" should return a nonzero exit code when not found: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls 0.0.2" should display only version 0.0.2.: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls 0.2" should display only 0.2.x versions.: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls foo" should return a nonzero exit code when not found: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls io" should return NA: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls node_" should return a nonzero exit code when not found: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls stable" and "nvm ls unstable" should return the appropriate implicit alias: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls system" should include "system" when appropriate: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should display all installed versions.: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should filter out ".nvm": Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should filter out "versions": Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should include "system" when appropriate: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" should list versions in the "versions" directory: Invalid argument
error: unable to create file test/fast/Listing versions/Running "nvm ls" with node-like versioning vx.x.x should only list a matched version: Invalid argument
error: unable to create file test/fast/Running "nvm alias" should create a file in the alias directory.: Invalid argument
error: unable to create file test/fast/Running "nvm current" should display current nvm environment.: Invalid argument
error: unable to create file test/fast/Running "nvm deactivate" should unset the nvm environment variables.: Invalid argument
error: unable to create file test/fast/Running "nvm install" with "--reinstall-packages-from" requires a valid version: Invalid argument
error: unable to create file test/fast/Running "nvm install" with an invalid version fails nicely: Invalid argument
error: unable to create file test/fast/Running "nvm unalias" should remove the alias file.: Invalid argument
error: unable to create file test/fast/Running "nvm uninstall" should remove the appropriate directory.: Invalid argument
error: unable to create file test/fast/Running "nvm uninstall" with incorrect file permissions fails nicely: Invalid argument
error: unable to create file test/fast/Running "nvm unload" should unset all function and variables.: Invalid argument
error: unable to create file test/fast/Running "nvm use foo" where "foo" is circular aborts: Invalid argument
error: unable to create file test/fast/Running "nvm use iojs" uses latest io.js version: Invalid argument
error: unable to create file test/fast/Running "nvm use system" should work as expected: Invalid argument
error: unable to create file test/fast/Running "nvm use x" should create and change the "current" symlink: Invalid argument
error: unable to create file test/fast/Running "nvm use x" should not create the "current" symlink if $NVM_SYMLINK_CURRENT is false: Invalid argument
error: unable to create file test/slow/Running "nvm current" should display current nvm environment.: Invalid argument
error: unable to create file test/slow/nvm exec/Preamble works and respects "silent" flag: Invalid argument
error: unable to create file test/slow/nvm exec/Running "nvm exec --lts" should work: Invalid argument
error: unable to create file test/slow/nvm exec/Running "nvm exec 0.x" should work: Invalid argument
error: unable to create file test/slow/nvm exec/Running "nvm exec" should pick up .nvmrc version: Invalid argument
error: unable to create file test/slow/nvm reinstall-packages/Running "nvm copy-packages $(nvm ls current)" should error out: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run --harmony --version" should work: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run --lts" should work: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run 0.x" should error out sensibly when 0.x is not installed: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run 0.x" should work: Invalid argument
error: unable to create file test/slow/nvm run/Running "nvm run" should pick up .nvmrc version: Invalid argument
error: unable to create file test/slow/nvm uninstall/Running "nvm uninstall 0.12.6" uninstalls v0.12.6: Invalid argument
error: unable to create file test/slow/nvm uninstall/Running "nvm uninstall" with incorrect file permissions fails nicely: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use --lts" uses latest LTS version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use --lts=foo" uses latest "foo" LTS version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use iojs" uses latest io.js version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use node" uses latest stable node version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use v1.0.0" uses iojs-v1.0.0 iojs version: Invalid argument
error: unable to create file test/slow/nvm use/Running "nvm use" calls "nvm_die_on_prefix": Invalid argument
fatal: unable to checkout working tree
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'
Failed to clone nvm repo. Please report this!
nvm ls
output:How did you install
nvm
? (e.g. install script in readme, homebrew):What steps did you perform?
What happened?
What did you expect to happen?
Is there anything in any of your profile files (
.bashrc
,.bash_profile
,.zshrc
, etc) that modifies thePATH
?curl -I --compressed -v https://nodejs.org/dist/
print out?The text was updated successfully, but these errors were encountered: