-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
curl-install-sh: fatal: bad object
from git clone steps
#3393
Comments
The The issue with the git syntax suggests your git version is unsupported - we require v1.7.10, per the readme. What version do you have? |
I had installed the [email protected] where it informed me I needed to install it from the shell script. I understand it didn't do anything, I just didn't bother to remove it back then. Git is 2.45.2 as I stated in the top (operating system/version). I don't know, to me it really look like just a cygwin-to-git4win path conversion issue. Again, it installed when I switched to Unless I'm mistaken, cygwin automatically translates paths passed to non-cygwin commands. When it's in the format This issue should only trigger when using WSL or cygwin with non-native builds of git. The solution that works for me though, probably doesn't for WSL. |
What happens if you use a cygwin-installed git, so that it's not using the windows git? |
Using cygwin-installed git (yet, of course, Windows-installed node), it works. Tested in a somewhat similar station with git 2.31.1, node 14.17.6, and cygwin1.dll 3.2.0.
|
Windows-installed node shouldn't matter because nvm doesn't itself use node. OK, thanks! That means that nvm's install script either needs to detect windows-installed git, ideally with feature detection, and either a) error out, or b) change the git commands so they work. Alternatively, cygwin could (and probably should) add support for |
Oh, sure, right!
Ya, erroring (a) could be frustrating to the user, but not bulldozing directories where they shouldn't will definitively help at least measure the worth of treating this edge case. Adapting the commands (b) should involve some magic I'm not sure is worth for the script maintainability over the long run. conceptual scriptif [ "${OSTYPE}" == "cygwin" ]; then
if ldd "$(which git)" | egrep -q "^[ "$'\t'"]*cygwin1.dll "; then
INSTALL_DIR_CONVERTED="$(cygpath -w "$(readlink -f "${INSTALL_DIR}")")"
fi
fi Basically, if under cygwin -and- the Git-windows ldd output
Git-cygwin ldd output
So, not sure this edgy case is worth this much trouble.
This brings us to another long piece. In summary, I was mistaken. Cygwin doesn't do any path conversion and it worked by luck. The Gory detailsI was double-checking this... and seems cygwin doesn't really do any path translation. And I tried some commands to see what happens. And turns out that git-for-windows version does interpret the path and creates the directories. Say, I have I noticed what happened here was, all stuff was installed and set up in
Thus, I see there's no conversion made by cygwin at all, git-for-win just install everything outside of the actual user's home. Just, for some reason, Then I believe In the end, I had It indeed worked because, at least So I had very close branches in both directories, so whenever the script called git-win, it worked on the "foreign" repo, but whenever the rest of the script referred to the actual directory, it found what it expected. 😄 Then again, no telling what else was left not done in one directory but done in another, if you follow the thought. It seemed to have worked, but I didn't try too many things, I'm new with nvm. bottomlineIn the end, for my use case, I was setting up a server service, something I'd need to run as network service, so as nvm is something user-scoped it wouldn't really help and I will need to keep node up-to-date in the server the oldschool way. So that's another reason it could be safer to just error out and see if more people raise here hitting this wall. This issue might also be affected by git-bash-here (git for windows context menu item). I believe they use MSYS, and it seems this one does auto path conversion so... |
Operating system and version:
Windows Server 2012 R2
NodeJS 20.15.1
Git for Windows 2.45.2.windows.1
Cygwin1.dll 3.4.5
nvm debug
output:# command not found?
nvm ls
output:# command... not found.
How did you install
nvm
?curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
What steps did you perform?
Ran the install command
What happened?
install.sh script output
What did you expect to happen?
Install nvm.
Is there anything in any of your profile files that modifies the
PATH
?~/.bash_profile
If you are having installation issues, or getting "N/A", what does
curl -I --compressed -v https://nodejs.org/dist/
print out?bottomline
If I download/checkout and edit
install.sh
and change all--git-dir="${INSTALL_DIR}/.git" --work-tree="${INSTALL_DIR}"
with just-C "${INSTALL_DIR}"
the script runs to completion.`$ cat install.sh | bash`
This happens because I'm running git for windows from a cygwin shell, so the linux-like path provided in
--git-dir
doesn't get translated correctly. It seems both-C
and--work-tree
are translated correctly. I didn't retry the script just dropping--git-dir
as it would probably fail as my current working directory was not~/.nvm
.So, perhaps replacing the command to use
-C
could be a bit more portable. Maybe checking"${OSTYPE}" == "cygwin"
could create an exception, if using both work-tree and git-dir is meant to solve issues with a specific OS/environment.Hope this helps improve NVM!
edit: this issue is probably the same reported in #3329.
The text was updated successfully, but these errors were encountered: