brock / node-reinstall

Complete Node Reinstall for OSX and Linux
http://git.io/node-reinstall
544 stars 72 forks source link

Error with oh-my-zsh #15

Closed ghost closed 9 years ago

ghost commented 9 years ago

I've tried to run node-reinstall, and everything appears to run well until it gets to sourcing, where I receive this error:

Sourcing your ~/.zshrc file.
/Users/aaren/.oh-my-zsh/oh-my-zsh.sh: line 26: syntax error near unexpected token `('
/Users/aaren/.oh-my-zsh/oh-my-zsh.sh: line 26: `for config_file ($ZSH/lib/*.zsh); do'

After this error is received, I also noticed my node-reinstall file is removed from my /usr/local/bin.

Any ideas? Thanks!

brock commented 9 years ago

@aarenhofferth

Regarding the node-reinstall location: The installer copies the actual node-reinstall to $HOME/bin/node-reinstall. Actually, bpkg does install this to /usr/local/bin/node-reinstall.

Line 114 of the script removes anything in $PREFIX/bin/node*, so I can see where we're actually deleting node-reinstall each time this runs. Confirmed bug. :)

Regarding the oh-my-zsh error: I use oh-my-zsh as well, and I've not seen that error. Looking at the source code in oh-my-zsh, I'd guess it could be related to one of two things:

  1. Either the $ZSH variable has gotten unset (node-reinstall doesn't do that though)
  2. There might possibly be a script found when running $ZSH/lib/*.zsh that doesn't "validate" (for lack of a better word).

You should be able to confirm that you have that directory and files in it: cd $ZSH/lib

ghost commented 9 years ago

Ok great I'll check that out. Thanks!

brock commented 9 years ago

@aarenhofferth what OS are you running this on?

ghost commented 9 years ago

Mac OSX 10.10.3 (Yosemite)

brock commented 9 years ago

I doubt it is related, @aarenhofferth, but I pushed a fix that prevents the installer from deleting itself from /usr/local/bin. Let me know if you still have issues.

brock commented 9 years ago

@aarenhofferth I tested this again, and when I scrolled back up through the logs, I found that I too was receiving that error. After looking at this, I'm removing the "sourcing" of the profile logic because I'm 99% certain that it doesn't have any effect anyway. Sourcing the script happens inside the sub-shell that runs when node-reinstall is run. But as soon as it returns us back to the primary shell, those sourced values aren't available anyway.

Version 0.0.7 fixes the error. Thanks!

ghost commented 9 years ago

Awesome thanks!

On Wednesday, April 15, 2015, Brock Angelo notifications@github.com wrote:

Closed #15 https://github.com/brock/node-reinstall/issues/15.

— Reply to this email directly or view it on GitHub https://github.com/brock/node-reinstall/issues/15#event-282690580.