Browse Source

Adding note about memory issues

Noah 7 years ago
parent
commit
9e6f8694df
1 changed files with 37 additions and 6 deletions
  1. 37 6
      INSTALL.md

+ 37 - 6
INSTALL.md View File

@@ -15,11 +15,13 @@ This would theoretically work on Windows, but it hasn't been tested.
15 15
 
16 16
 ## Ubuntu 14.04+ installation
17 17
 
18
+Note: if you're using something with very little memory, like a Digital Ocean micro droplet, it might cause an installation problem on the last step. See [Linux troubleshooting](INSTALL.md#linux-troubleshooting) below for how to fix it.
19
+
18 20
 An example bootstrap script for installing Audiogram on Ubuntu looks like this:
19 21
 
20 22
 ```sh
21 23
 # 14.04 only: add PPAs for FFmpeg and Libgroove
22
-# Not required for 15.04
24
+# Not required for 15.04+
23 25
 sudo add-apt-repository ppa:mc3man/trusty-media --yes
24 26
 sudo apt-add-repository ppa:andrewrk/libgroove --yes
25 27
 
@@ -45,14 +47,16 @@ sudo apt-get install redis-server --yes
45 47
 # Fix nodejs/node legacy binary nonsense
46 48
 sudo ln -s `which nodejs` /usr/bin/node
47 49
 
48
-# Upgrade node to the latest stable version
49
-# Or use a different method of your choosing (e.g. nvm)
50
-# Any node version later than v0.11.2 should work
50
+# Check the version of Node
51
+node -v
52
+
53
+# If the installed Node version is >= v0.11.2, you can skip the next step
54
+# If it's < v0.11.2, upgrade Node to the latest stable version
55
+# If you use this method, you'll probably need to reconnect afterwards
56
+# to see the new Node version reflected
51 57
 sudo npm install -g n
52 58
 sudo n stable
53 59
 
54
-# You'll probably need to reconnect to see the new Node version reflected
55
-
56 60
 # Clone the audiogram repo
57 61
 git clone https://github.com/nypublicradio/audiogram.git
58 62
 cd audiogram
@@ -144,3 +148,30 @@ If FFmpeg installation is failing, you can try following the [compilation guide]
144 148
 ### Installing node-canvas dependencies manually
145 149
 
146 150
 You can try installing the node-canvas dependencies with their detailed [Installation instructions](https://github.com/Automattic/node-canvas/wiki/_pages).  You don't need to install `node-canvas` itself, just everything up to that point.
151
+
152
+## Linux troubleshooting
153
+
154
+### Memory issues
155
+
156
+If you're installing Audiogram on a machine with very little memory, like a Digital Ocean micro droplet (512 MB), the `npm install` might fail mysteriously, or when you try to run Audiogram, you get an error message about `/node_modules/waveform/build/Release/waveform` missing because the installation didn't finish.
157
+
158
+There are three ways to solve this:
159
+
160
+1. Upgrade to something with more memory (1 GB should be enough)
161
+
162
+2. Remove `canvas` from the dependencies in `package.json`, run `npm install`, and then install `canvas` separately (it's the memory hog):
163
+
164
+```sh
165
+sed -i '/canvas/d' package.json
166
+npm install
167
+npm install git+https://github.com/chearon/node-canvas.git#b62dd3a9fa
168
+```
169
+
170
+3. Install clang to reduce npm's memory usage, and reinstall:
171
+
172
+```sh
173
+sudo apt-get update
174
+sudo apt-get install clang
175
+export CXX=clang++
176
+npm install --clang=1
177
+```