1

Following the instructions on this page I have run:

cabal update
cabal install elm
cabal install elm-server  # (Optional) For testing your code in a browser.
cabal install elm-repl    # (Optional) For experimenting with elm in a REPL.
cabal install elm-get     # (Optional) For sharing/using elm libraries.

Unfortunately, when I run elm-repl I get that it doesn't know where nodejs is:

Elm REPL 0.3 <https://github.com/elm-lang/elm-repl#elm-repl>
Type :help for help, :exit to exit

The REPL relies on node.js to execute JavaScript code outside the browser.
    It appears that you do not have node.js installed though!
    You can install node.js from <http://nodejs.org/>. If it is already
    installed but has a different name, use the --interpreter flag.

How can I point elm-repl in the right direction. The other 3 programs work fine so far.

john mangual
  • 7,718
  • 13
  • 56
  • 95

1 Answers1

2

If you have node.js installed but elm-repl can't find it, the problem is usually that the node.js executable cannot be found. Make sure that the executable is on your PATH, and check what it's name is. Node.js uses either node or nodejs as the name of the executable (I think it's version dependent), elm-repl expects it to be node. If your PATH only has a nodejs, just copy-and-rename to node and you should be good to go.

Apanatshka
  • 5,958
  • 27
  • 38
  • I added a symlink in `usr/bin/nodejs` to `usr/bin/node` and elm-repl works now http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04 – john mangual Oct 18 '14 at 13:15
  • Use the following command! sudo ln -s /usr/bin/nodejs /usr/bin/node – jp0d Jun 17 '17 at 11:19