-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Cannot run Node, Error 0x2 #527
Comments
What version of Git for Windows do you have installed? |
Here's the output of git --version, not sure if this is the version of git for windows sorry:
I just downloaded it about 20 minutes ago. |
And how did you source node? From nodejs.org? |
Yes, I tried installing both x86 and x64. |
@PaulBGD could you run |
That worked, thanks! Any reason why this could have happened? |
Hi @PaulBGD, I think the reason is the commit build-extra/44ed99b4 who add: alias node="winpty node.exe" But there is no Could you run |
@Kmelia I think the proper solution would be to test whether |
@dscho your solution seems good! |
Node seems to be working fine now. |
The question is: what are the two first bytes of that file? IOW what does dd if=/c/Program Files (x86)/nodejs/node bs=2 count=1 | od -t x1 print? |
|
Hmm. So it is not a Bash script as I had thought... Oh, I guess I misunderstood the culprit completely (my only defense is that I am a bit sleep deprived these days): the issue seems to be that 64-bit /me tests that clicketyclick Nope, 64-bit |
|
Hi @Saturn2888 you could add these lines to your ##### Git Bash for Windows >= 2.x
# remove the winpty Node aliases
unalias $(alias | grep winpty | grep node | cut -d"=" -f1 | cut -d" " -f2) ref: http://blog.kmelia.net/testing/coloration-dans-git-bash/123 |
I invite everybody to investigate why |
@Kmelia I'd love to, but somehow after installing Heroku w/ Git Bash and reinstalling Git from SCM, I lost the Git Bash prompt. Using SourceTree's embedded Git Bash, I got this error after creating a WARNING: Found ~/.bashrc but no ~/.bash_profile, ~/.bash_login or ~/.profile. So it looks like it took the |
Check what do you have now on your home directory. Git Bash creates for you a profile file to use the
You can also check if you have the node alias with the command |
Yeah, it created those other files and that warning went away the second time I loaded up Git Bash. alias ipython='winpty ipython.exe'
alias ll='ls -l'
alias ls='ls -F --color=auto --show-control-chars'
alias php='winpty php.exe'
alias php5='winpty php5.exe'
alias psql='winpty psql.exe'
alias python2.7='winpty python2.7.exe' |
So:
This is not correct ;) The unalias is done on the |
If you need to run node non-interactively, you can always call it directly with the Back to this ticket: between all the comments, my suggestion is running the danger of getting lost. So here it is again, in all its glory:
|
This cost me some time today, and searching let me here. The error symptom is a little confusing, but the issue is that the bash command can't find the exe that is being aliased. Given the hint about the alias file and with a little searching of the intertubes, I found a post on stackoverflow that says to use command -v to verify that bash (or whatever shell) can find the executable via the PATH variable. $ cat ./testCommands.sh $ ./testCommands.sh So changing the alias.sh file as suggested should at least stop the odd error and fail with the more obvious not found.. alias.sh That and getting all these things in my path and I'm ready to rock and roll. |
Actually.. to make this work, users are going to have to drop a shell script in /etc/profile.d/ that sets the path to all these things, if they aren't in the PATH setup by /etc/profile . To that end, I would recommend renaming the aliases.sh file to xaliases.sh (these are executed in alpha order), and tell users where to create the system path scripts. |
The proper way is to use |
You can find a good example here. |
The user is [now presented with a nice error message](git-for-windows/git#527) when calling `node` while `node.exe` is not in the `PATH` Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Then if I try to run it in bash:
My Node binary is x86 and I'm running bash on a 64 bit system.
The text was updated successfully, but these errors were encountered: