Deploy Phoenix/Elixir project issue: npm ERR! TypeError: Object.keys called on non-object

When you deploy you phoenix/elixir project on production and something goes wrong it is very useful to make a git clone of your project directly on production server and try to run it there via `iex -S mix` to see what’s wrong. This is actually no really good practice but one of the fastest options.

I also had something strange on my server and I cloned project there and when I run `npm install` to get all node packages for the `brunch` I realised that I’ve got wrong `node` version on prod:

npm http 404 https://registry.npmjs.org/phoenix_html
npm ERR! TypeError: Object.keys called on non-object
npm ERR!     at Function.keys (native)
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:708:24)
npm ERR!     at /usr/share/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     
npm ERR! or email it to:
npm ERR!     
npm ERR! System Linux 3.5.0-17-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install"
npm ERR! cwd /home/awesomebot/source/phoenix

npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10

npm ERR! type called_on_non_object
npm ERR! Error: No compatible version found: [email protected]'file:deps/phoenix'
npm ERR! Valid install targets:
npm ERR! ["0.1.1-dev","1.2.0-rc.0"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:719:10)
npm ERR!     at /usr/share/npm/lib/cache.js:638:10
npm ERR!     at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7)
npm ERR!     at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7
npm ERR!     at Object.oncomplete (fs.js:107:15)
npm ERR! If you need help, you may report this log at:
npm ERR!     
npm ERR! or email it to:
npm ERR!     

As `brunch` work on node >= 4.0.0 we need to upgrade nodejs. I upgraded nodejs from `v0.10.25` to `v4.4.4` with this askubuntu post:

curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs

After this running `iex -S mix phoenix.server` was fine.