New to Elixir - tried to use the -- sname command but it's not working

I just got initiated to Elixir and reading the book (programming Elixir ) I got to where I wanted to create 2 communicating nodes. I tried to use the – sname command to create a node with a name but the 1ex says
'** (syntax error) iex:5 syntax error before : ‘–’ . What could be worng.

You are putting the --sname switch on the commandline yes? Like in:

$ iex --sname devserver -S mix phoenix.server

Or whatever your args are? Standard shell args, not elixir’y, just normal shell. :slight_smile:

1 Like

yes I just type it after the prompt on the iex . Is that wrong ?

I think I got it (tried to reproduce your error). You started iex and then prompted --sname wobble into iex session. Close iex (double ctrl+c) and just enter into the terminal: iex --sname wobble, as @OvermindDL1 suggested (you should do it without -S mix phoenix.server, just iex --sname wobble as it in the book).


Thanks for the reply . Ctrl+ C does not exit my iex for some reason . I used and then q + , and I typed

iex --sname wobble . still getting same error.

do I type it before the erlang otp… come on.?

Yes. It should look like this.

$> iex --sname wobbel
Erlang/OTP 19 [erts-8.2] [source] [64-bit] [smp:8:8] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]

Interactive Elixir (1.4.0) - press Ctrl+C to exit (type h() ENTER for help)

Your workflow should be to open a terminal emulator of your choice. Then type iex --sname wobbler.

If you have used some shortcut to fire up iex directly before we will need some further information about your system to give you some advice about how to proceed. That’s operating system and window manager (if not windows).


Are you doing -- sname or --sname? Just want to make sure that the space that’s in your post, is not in reality…


sorry I believe I got the spacing right.

Thanks for the insight . My Elixir is on my task bar i just click on it and the shell comes on . I have a windows 7 system. As soon as the shell comes on it shows the erlang … then interactive elixir and
iex(1) with the prompt . Then I try to type the --sname .

That is most certainly not the terminal. :wink:
Type it as I put it in my first post, but in the terminal. ^.^


Which you can open the following ways

  • win+r and then cmd and enter
  • win and then command prompt and enter
  • win+t but I’m not quite sure about this one.

Thanks for the help . Finally figured it out


Thanks for the help . Finally saw the light


I have the same issue. Could you please let me know how to solve it? Thank you very much!