Skip to content

Instantly share code, notes, and snippets.

@evancz
Created August 21, 2018 05:21
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save evancz/442b56717b528f913d1717f2342a295d to your computer and use it in GitHub Desktop.
Save evancz/442b56717b528f913d1717f2342a295d to your computer and use it in GitHub Desktop.
Instructions for installing Elm 0.19 on Linux

Install on Linux

Elm 0.19 just came out, so the npm installer is not ready yet. In the meantime, you can download it manually like this:

wget "https://github.com/elm/compiler/releases/download/0.19.0/binaries-for-linux.tar.gz"
tar xzf binaries-for-linux.tar.gz
mv elm /usr/local/bin/

Moving the binary to /usr/local/bin should make it available on your PATH so you can call it from anywhere.

@fabienengels
Copy link

Congrats for this new version ! Do you plan to continue to distribute this binary even when the npm installer will be ready ? It's nice to just have a binary to copy and not to deal with npm :)

@romanzolotarev
Copy link

@evancz do you use GHC 7.10 to build ElmPlatform?

Trying to build it on OpenBSD, following this guide:
https://raw.githubusercontent.com/elm/elm-lang.org/master/README.md

@eloraiby
Copy link

@evancz I would second that, having just the binaries instead of npm universe is better

@ganwell
Copy link

ganwell commented Aug 23, 2018

Just for anyone who didn't get it (like me at first): all the binaries we had for 0.18 are merge into a single one: elm

@OnorioCatenacci
Copy link

Thanks for this @evancz. Worked like a charm.

@katofares
Copy link

katofares commented Aug 24, 2018

I have this problem but I can't understand why???
elm-error

even from my browser I can't connect to the elm packages(https://package.elm-lang.org/) !!
anyone had this prolem? any help???

@juhp
Copy link

juhp commented Aug 29, 2018

+1 for downloadable binaries

@dela3499
Copy link

Perhaps I made a mistake while uninstalling my previous Elm version, but I needed to run

hash elm

before bash would recognize the location of the new elm binary at /usr/local/bin. (See Stack Overflow answer)

@ethagnawl
Copy link

Works like a charm!

I do have some feedback, though.

1.) Perhaps "binaries-for-linux.tar.gz" should be changed to something a bit more descriptive (e.g. elm-0.19.binaries-for-linux.tar.gz) or the wget example should make use of the -O flag (e.g. wget -O elm-0.19-binaries.targ.gz "https://github.com/elm/compiler/releases/download/0.19.0/binaries-for-linux.tar.gz")? It's not inconceivable that the user could already have a file named binaries-for-linux.tar.gz on their system.
2.) Either prefix the mv command with sudo or mention that it may be required. Alternatively, consider suggesting the user place the binary in a directory they own (e.g. ~/bin).

@remarbach
Copy link

0.19 elm reactor is missing the --address=0.0.0.0 flag. I need this functionality because I develop on a linode server using a browser on a chromebook.

@simvux
Copy link

simvux commented Sep 4, 2018

Not having to touch npm to install elm is a huge bonus for me!

@dtonhofer
Copy link

Installing elm 0.19.0 using npm seems to work now (2018-09-18). (Can you even add properly add elm modules without npm?)

Repeat of my installation instructions on Fedora 28:

  • I install in the home directory of user devman, which is the user whose mission is to explore new worlds and new civilizations.
  • Goal: to have an installation like the following: All the stuff under ~/node/infrastructure, with symlinks pointing to the currently used version:
node
├── infrastructure
│   └── node-v10.10.0
│       ├── bin
│       ├── include
│       ├── lib
│       └── share
└── node-v10 -> infrastructure/node-v10.10.0/
  • Get the Node source (tarball) from https://nodejs.org/en/download/current/
  • Unpack (tar xzf will untar the Node tarball into a separate directory), cd to unpacked directory, then configure using:
  • ./configure --prefix=/home/devman/node/infrastructure/$(basename $(pwd))
  • Then make (this takes a long time)
  • Then make test
  • Then make install. You end up with the structure above in the home directory (hopefully).
  • Create symlinks as needed: cd ~/node; ln -s infrastructure/node-v10.10.0 node-v10
  • Modify PATH (this needs to be added to ~/.bashrc, too): export PATH=/home/devman/node/node-v10/bin:$PATH
  • Create a copy of the installed file tree for fallback: cd ~; cp -a node/ node.initial
  • Now we have the following, as shown by tree -L 4 ~/node:
node/
├── infrastructure
│   └── node-v10.10.0
│       ├── bin
│       │   ├── node
│       │   ├── npm -> ../lib/node_modules/npm/bin/npm-cli.js
│       │   └── npx -> ../lib/node_modules/npm/bin/npx-cli.js
│       ├── include
│       │   └── node
│       ├── lib
│       │   └── node_modules
│       └── share
│           ├── doc
│           ├── man
│           └── systemtap
└── node-v10 -> infrastructure/node-v10.10.0/
  • Install elm: npm install -g elm
  • After that, check that the elm executable is the one expected: which elm should give ~/node/node-v10/bin/elm and elm --version should give 0.19.0.
  • Now we have the following, as shown by tree -L 4 ~/node:
node
├── infrastructure
│   └── node-v10.10.0
│       ├── bin
│       │   ├── elm -> ../lib/node_modules/elm/bin/elm
│       │   ├── node
│       │   ├── npm -> ../lib/node_modules/npm/bin/npm-cli.js
│       │   └── npx -> ../lib/node_modules/npm/bin/npx-cli.js
│       ├── include
│       │   └── node
│       ├── lib
│       │   └── node_modules
│       └── share
│           ├── doc
│           ├── man
│           └── systemtap
└── node-v10 -> infrastructure/node-v10.10.0/
node
├── infrastructure
│   └── node-v10.10.0
│       ├── bin
│       │   ├── elm -> ../lib/node_modules/elm/bin/elm
│       │   ├── elm-test -> ../lib/node_modules/elm-test/bin/elm-test
│       │   ├── node
│       │   ├── npm -> ../lib/node_modules/npm/bin/npm-cli.js
│       │   └── npx -> ../lib/node_modules/npm/bin/npx-cli.js
│       ├── include
│       │   └── node
│       │       └── (...various...)
│       ├── lib
│       │   └── node_modules
│       │       ├── elm
│       │       ├── elm-test
│       │       └── npm
│       └── share
│           ├── doc
│           │   └── node
│           ├── man
│           │   └── man1
│           └── systemtap
│               └── tapset
└── node-v10 -> infrastructure/node-v10.10.0/

Let's try this out.

@ericgj
Copy link

ericgj commented Oct 15, 2018

sudo npm install -g elm worked for me now, with a bit of a hiccup related to npm permissions and binwrap: see workarounds here -> avh4/binwrap#8

@nkhine
Copy link

nkhine commented Oct 16, 2018

this works for me

 khinester@MBM-DT111  ~  npm install -g elm                                                                                                             ✔  1102  12:19:26
npm WARN deprecated graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
/home/khinester/.nvm/versions/node/v8.12.0/bin/elm -> /home/khinester/.nvm/versions/node/v8.12.0/lib/node_modules/elm/bin/elm

> elm@0.19.0-bugfix2 install /home/khinester/.nvm/versions/node/v8.12.0/lib/node_modules/elm
> binwrap-install

+ elm@0.19.0-bugfix2
added 89 packages from 73 contributors in 39.935s
 khinester@MBM-DT111  ~  elm --version                                                                                                                1 ↵  1104  12:20:38
0.19.0

@mlopes
Copy link

mlopes commented Oct 16, 2018

Just got here, linked from this page https://guide.elm-lang.org/install.html and I'm wondering if this is still up to date, as it looks like people are now using npm to install elm and the instructions were last updated 2 months ago, or if the manual install is still the preferred solution?

@nkhine
Copy link

nkhine commented Oct 16, 2018

i am not sure, but i am having this issue now: ktonon/elm-serverless-demo#5

@helinaabye
Copy link

I have this problem but I can't understand why???
elm-error

even from my browser I can't connect to the elm packages(https://package.elm-lang.org/) !!
anyone had this prolem? any help???

I had the same error message on windows and it worked when I made a firewall exception rule for elm.

@jesskfullwood
Copy link

I think this guide is out of date. Now you can just run

npm install -g elm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment