lix-pm / lix.client

A dependable package manager for your Haxe projects
The Unlicense
118 stars 23 forks source link

[linux] Syntax error: word unexpected (expecting ")") #199

Open acarioni opened 2 weeks ago

acarioni commented 2 weeks ago

I have installed Haxe 4.3.4 using Lix 15.12.0 on Ubuntu 22.04. However, when I attempt to run Haxe, I encounter the following error:

haxelib path: /home/ubuntu/haxe/versions/4.3.4/haxelib: 1: Syntax error: word unexpected (expecting ")")

No error occurs when I install Haxe with apt-get.

back2dos commented 2 weeks ago

Seems to be a shell error: https://stackoverflow.com/questions/36725864/syntax-error-word-unexpected-expecting

The haxelib.sh is generated by npm, so I would have to guess there is some mismatch between your default shell and your npm version.

Your error is rather peculiar, since running lix and haxe seems to not have produced that error. If I had to guess, I would conclude that you invoked them from another shell (i.e. not the default shell on your OS) and then when haxe tries to invoke haxelib.sh, it uses the default OS shell, which cannot properly process the script, probably due to one of the reasons mentioned in the stackoverflow post.

acarioni commented 2 weeks ago

This is very strange, as I used the bash shell for everything on a fresh virtual machine.

back2dos commented 2 weeks ago

Hmm. Does invoking haxelib directly produce the error?

acarioni commented 2 weeks ago

Yes, it produces /home/ubuntu/haxe/versions/4.3.4/haxelib: 1: Syntax error: word unexpected (expecting ")")

back2dos commented 1 week ago

Hmm. And haxe doesn't? Can you check the both scripts to see if there's any difference?

acarioni commented 1 week ago

Haxe is producing the same error.

To summarize:

$ haxe
haxelib path: /home/ubuntu/haxe/versions/4.3.4/haxelib: 1: Syntax error: word unexpected (expecting ")")

$ haxelib
/home/ubuntu/haxe/versions/4.3.4/haxelib: 1: Syntax error: word unexpected (expecting ")")
back2dos commented 1 week ago

Well, yes and no. Haxe is calling haxelib (no idea why, really, but that's another matter) and that then produces the error. But the haxe script itself seems to parse (and run) fine. Can you spot any obvious difference between it and the haxelib script?