2014-10-16 48 views
1

根据这一页我已经运行上的说明:ELM-REPL找不到的NodeJS

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. 

不幸的是,当我运行elm-repl我得到它不知道哪里是的NodeJS:

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. 

我怎么能指向elm-repl在正确的方向。其他3个程序目前工作正常。

回答

2

如果您安装了node.js,但elm-repl无法找到它,问题通常是无法找到node.js可执行文件。确保可执行文件在你的PATH上,并检查它的名字是什么。 Node.js使用nodenodejs作为可执行文件的名称(我认为它的版本相关),elm-repl期望它是node。如果您的PATH只有nodejs,只需复制并重命名为node,那么您应该很好。

+0

我在'usr/bin/nodejs'中添加了一个符号链接到'usr/bin/node'和elm-repl现在工作http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu -12-04 – 2014-10-18 13:15:56

+0

使用以下命令! sudo ln -s/usr/bin/nodejs/usr/bin/node – jp0d 2017-06-17 11:19:22