on master help sign in
update npm readme to be clearer about intended usage
d15ccb8Evan Czaplicki
installers/npm/README.md+15−15
@@ -2,33 +2,33 @@
2
2
3[Elm](https://elm-lang.org) is a functional programming language that compiles to JavaScript.
3[Elm](https://elm-lang.org) is a functional programming language that compiles to JavaScript.
4
4
5−There are installers for Mac and Windows available [here](https://github.com/elm/compiler/releases/tag/0.19.1). There are also binaries for direct download. These are the most reliable ways to install Elm.
5+Head over to [The Official Guide](https://guide.elm-lang.org/) to start learning Elm!
6
6
7−This package tries to download those binaries with `npm`. It is sometimes used by people intergating Elm into existing projects or workflows.
8
7
9<br/>
8<br/>
10
9
10+## What is this package for?
11
11
12−## Install
12+**For normal installs? No.** Use the instructions [here](https://guide.elm-lang.org/install/elm.html) instead.
13
13
14−The following command should download the `elm` binary:
14+**For multiple versions? Yes.** People using Elm at work may use different versions of Elm in different projects. They can run `npm install elm@latest-0.19.1` in each project and use the binary at `./node_modules/.bin/elm` for compilation.
15
15
16−```
16+**For continuous integration? Maybe.** It is possible to download binaries directly from GitHub with a script like [this](https://github.com/elm/compiler/blob/master/installers/linux/README.md) which is strictly more reliable than going through `npm`. Even better is to host the binaries such that you are not downloading from external services on each build.
17−npm install -g elm
18−```
19
17
20−If this runs successfully, the `elm` binary should be available at:
21
18
22−- `/usr/local/bin/elm` on Mac and Linux
19+<br/>
23−- `C:\Users\YOUR_NAME\AppData\Roaming\npm\` on Windows
24
20
25−It should be possible to run `elm` from your terminal after this.
21+## Install Locally
26
22
27−If you run into trouble, check out [troubleshooting.md](troubleshooting.md).
23+The following command should download the latest Elm 0.19.1 binary:
28
24
29−<br/>
25+```
26+npm install elm@latest-0.19.1
27+```
30
28
29+You should be able to run `./node_modules/bin/elm --version` within your project and see `0.19.1`. Now you can compile with `./node_modules/bin/elm make src/Main.elm` and not disrupt other packages.
31
30
32−## What is next?
31+Use `npm install elm@latest-0.19.0` or `npm install elm@latest-0.18.0` for earlier versions.
32+
33+**Note:** The `latest-X.Y.Z` convention is used in case we need to publish patches for the `npm` installer within a given Elm release. For example, say `npm` decides that some transitive dependency is not secure. Nothing is changing about Elm or the binaries, but we need to publish a new `npm` installer that fixes this issue.
33
34
34−Head over to [The Official Guide](https://guide.elm-lang.org/) to start learning Elm!