git.iko.soy/lynxjs-elm/compiler
on master help sign in
update npm readme to be clearer about intended usage
commitd15ccb8ab30933186e8697967476a7c87da4aa27 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 21 Oct 2019, 16:51 (7 years ago) parent874ec5d
1 file changed+15−15
installers/npm/README.md+15−15
installers/npm/README.md+15−15
@@ -2,33 +2,33 @@
22
33[Elm](https://elm-lang.org) is a functional programming language that compiles to JavaScript.
44
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!
66
7−This package tries to download those binaries with `npm`. It is sometimes used by people intergating Elm into existing projects or workflows.
87
98<br/>
109
10+## What is this package for?
1111
12−## Install
12+**For normal installs? No.** Use the instructions [here](https://guide.elm-lang.org/install/elm.html) instead.
1313
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.
1515
16−```
17−npm install -g elm
18−```
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.
1917
20−If this runs successfully, the `elm` binary should be available at:
2118
22−- `/usr/local/bin/elm` on Mac and Linux
23−- `C:\Users\YOUR_NAME\AppData\Roaming\npm\` on Windows
19+<br/>
2420
25−It should be possible to run `elm` from your terminal after this.
21+## Install Locally
2622
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:
2824
29−<br/>
25+```
26+npm install elm@latest-0.19.1
27+```
3028
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.
3130
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.
3334
34−Head over to [The Official Guide](https://guide.elm-lang.org/) to start learning Elm!