on master help sign in
make the README clearer and add troubleshooting.md
commit35b0c9bbf7e8293c2f7fec1d9648488620d6885a authorEvan Czaplicki <evancz@users.noreply.github.com> dateFri 30 Aug 2019, 11:59 (7 years ago) parentf08cc23
2 files changed+76−23
installers/npm/README.md+14−23 installers/npm/troubleshooting.md+62
installers/npm/README.md+14−23
@@ -1,38 +1,29 @@
1−npm install elm [![Travis build Status](https://travis-ci.org/elm-lang/elm-platform.svg?branch=master)](http://travis-ci.org/elm-lang/elm-platform) [![AppVeyor build status](https://ci.appveyor.com/api/projects/status/6mcub79i04ianpm9/branch/master?svg=true)](https://ci.appveyor.com/project/rtfeldman/elm-platform/branch/master)
2−===============
1+# npm install elm
32
4−Install the [Elm Platform](https://github.com/elm-lang/elm-platform) via [`npm`](https://www.npmjs.com).
3+[Elm](https://elm-lang.org) is a functional programming language that compiles to JavaScript.
54
6−## Installing
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.
76
8−Run this to get the binaries:
7+This package tries to download those binaries with `npm`. It is sometimes used by people intergating Elm into existing projects or workflows.
8+
9+<br/>
910
10−```
11−$ npm install -g elm
12−```
1311
14−## Installing behind a proxy server
12+## Install
1513
16−If you are behind a proxy server, set the environment variable "HTTPS_PROXY".
14+The following command should download the `elm` binary:
1715
1816```
19−$ export HTTPS_PROXY=$YourProxyServer$
20−$ npm install -g elm
17+npm install -g elm
2118```
2219
23−Or on Windows:
20+If it runs successfully, it should make `elm` available at `/usr/local/bin/elm` on Mac and Linux or at `C:\Users\YOUR_NAME\AppData\Roaming\npm\` on Windows.
2421
25−```
26−$ set HTTPS_PROXY=$YourProxyServer$
27−$ npm install -g elm
28−```
22+If you run into trouble, check out [troubleshooting.md](troubleshooting.md).
2923
30−## Troubleshooting
24+<br/>
3125
32−1. [Troubleshooting npm](https://github.com/npm/npm/wiki/Troubleshooting)
33−2. On Debian/Ubuntu systems, you may have to install the nodejs-legacy package: `apt-get install nodejs-legacy`.
34−3. If the installer says that it cannot find any usable binaries for your operating system and architecture, check the [Build from Source](https://github.com/elm-lang/elm-platform/blob/master/README.md#build-from-source) documentation.
3526
36−## Getting Started
27+## What is next?
3728
38−Once everything has installed successfully, head over to the [Get Started](http://elm-lang.org/Get-Started.elm) page!
29+Head over to [The Official Guide](https://guide.elm-lang.org/) to start learning Elm!
installers/npm/troubleshooting.mdnew file+62
@@ -0,0 +1,62 @@
1+# Troubleshooting
2+
3+I very highly recommend asking for help on [the Elm slack](https://elmlang.herokuapp.com).
4+
5+There are a lot of things that can go wrong when installing software, and it can really help to have a second pair of eyes on your situation!
6+
7+This document goes through a couple options that may help you out!
8+
9+
10+## Can you skip npm entirely?
11+
12+The most reliable way to get Elm installed using the official installers for Mac and Windows [here][download].
13+
14+You can also download the binaries directly. On Linux, you could do it in the terminal like this:
15+
16+```bash
17+curl -o elm.gz https://github.com/elm/compiler/releases/download/0.19.1/binary-for-linux-64-bit.gz
18+gunzip elm.gz # unzip the file
19+chmod +x elm # make the file executable
20+mv elm /usr/local/bin/ # put the executable in a directory likely to be listed in your PATH variable
21+```
22+
23+If these exact commands do not work for you, you can try to do the same thing by hand.
24+
25+[download]: https://github.com/elm/compiler/releases/tag/0.19.1
26+
27+
28+## Do you need to use npm for some reason?
29+
30+The company running npm has a list of common troubleshooting situations [here](https://npm.community/c/support/troubleshooting).
31+
32+### Firewalls
33+
34+Some companies have a firewall and want to route traffic through a proxy server.
35+
36+Usually that means you have a `HTTPS_PROXY` environment variable set on your computer.
37+
38+If you want to try to set it temporarily to see what happens, you can try something like this:
39+
40+```
41+# Mac and Linux
42+HTTPS_PROXY=http://proxy.example.com npm install -g elm
43+
44+# Windows
45+set HTTPS_PROXY=http://proxy.example.com
46+npm install -g elm
47+```
48+
49+## Do you know what a `PATH` variable is?
50+
51+When you run a command like `elm make src/Main.elm`, your computer starts by trying to find a file called `elm`.
52+
53+The `PATH` is a list of directories to search within. On Mac and Linux, you can see these directories by running:
54+
55+```
56+$ echo $PATH
57+/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin
58+```
59+
60+The are separated by `:` for some reason. So running `elm make src/Main.elm` starts by searching the `PATH` for files named `elm`. On my computer, it finds `/usr/local/bin/elm` and then can actually run the command.
61+
62+Is `elm` in one of the directories listed in your `PATH` variable? I recommend asking for help if you are in this scenario and unsure how to proceed.