Skip to content
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

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

Open
acarioni opened this issue Jun 27, 2024 · 7 comments
Open

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

acarioni opened this issue Jun 27, 2024 · 7 comments

Comments

@acarioni
Copy link

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
Copy link
Contributor

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
Copy link
Author

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

@back2dos
Copy link
Contributor

Hmm. Does invoking haxelib directly produce the error?

@acarioni
Copy link
Author

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

@back2dos
Copy link
Contributor

back2dos commented Jul 2, 2024

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

@acarioni
Copy link
Author

acarioni commented Jul 2, 2024

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
Copy link
Contributor

back2dos commented Jul 4, 2024

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants