Installing Node.js on Dreamhost Dedicated Server

I recently enquired to Dreamhost about hosting a fully-functional, production-ready node.js server so that I may host my Angular 2 apps.

After upgrading from a shared VPS to a dedicated server, I now have root access, but I need to install my own version of Node.js, as the version that comes with Node.js on the server is v0.12.0.

Fair enough, but there are a ton of different directories.

I know that I could possibly download the node.js package anywhere on my server, but does anyone know where I should specifically download my node installation on a Dreamhost dedicated server?

It seems out of the box, my dedicated server came with the following npm/node combination:

Node v0.12.0 / NPM 2.5.1

I really didn’t know where to turn after that, all I knew is that when I tried to install the Angular 2 source code files to one of my sites, I received an error that was analogous to my Node version being too old. So I knew I had to install my own version of Node. After speaking with DH staff, they told me the same thing. That I would need to install my own version of Node on my dedicated DH server.

I was under the impression that I would need to install it somewhere different than the default location (a location I will not repost here, as I assume anyone who is not a dedicated DH customer knowing these paths would be a security risk). However, I went to the Node.js official site and was unclear as to which version I should install. So I googled how to find my dedicated server stats and found the following command:

cat /etc/*-release

this returned that my dedicated server was Ubuntu 12.04.5 LTS, Precise Pangolin

I then proceeded to go back to the Node.js website and find the installation instructions for Ubuntu Precise Pangolin, which according to the official Node.js site, was compatible with Node.js 6.0 or earlier.

I then installed Node.js using the following recommended command:

  1. curl -sl | sudo -E bash -

the Node v6.x repo downloaded pretty fast, after which I had to run the following install command:

  1. sudo apt-get install -y nodejs

It worked!

After checking my versions of Node and NPM, I could see the following:

Node.js v6.9.4
NPM 3.10.10

Keep in mind this was the recommended Node.js install for the Dreamhost dedicated server.

I will post updates when I try to git clone an Angular 2 project and see if my npm install for the project downloads successfully or craps out again.
After trying my install again, it seems I was halted because of the following error:

npm ERR! node v6.9.4
npm ERR! npm v3.10.10

npm ERR! notsup Unsupported platform for fsevents@1.0.14: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
npm ERR! notsup Valid OS: darwin
npm ERR! notsup Valid Arch: any
npm ERR! notsup Actual OS: linux
npm ERR! notsup Actual Arch: x64

So it appears that fsevents NPM installation is having an issue with my Dreamhost server configuration. At least I have a new error right now, which means I possibly have gotten farther down the line that I previously had.

I will do some research and come back to update on the status of my Angular 2 installation.
Ok, the issue with fsevents@1.0.14 not having a supported platform for this Angular 2 ‘npm install’ seems to be addressed by the following link:

Apparently, when people downgrade to NPM 3.10.7, there doesn’t appear to be an issue.

I will try and return with the results.
Ok, since the official Node.js install originally installed NPM 3.10.10 and the Angular 2 git cloned installation’s fsevents had an installation issue with my Dreamhost dedicated server setup, I needed to DOWNGRADE to 3.10.7 (according to some of the Github chatter regarding this issue).

I googled a solution and it seems I can just have npm install over itself if I do it globally:

  1. check current NPM version by running “npm --version” (returns 3.10.10)
  2. force NPM to install version 3.10.7 globally by running “npm install -g npm@3.10.7”
  3. check current NPM version by running “npm --version” again (returns 3.10.7)

Since the Angular 2 file was already git cloned to my directory, I simply move to that directory and try an “npm install” again to see if it works…

(a few minutes later…)

Good news and bad news… the good news is that I no longer receive the Unsupported platform for fsevents@1.0.14 error anymore :slight_smile:

Bad news (or good news) is I now have a new error, as seen below:

npm ERR! node v6.9.4
npm ERR! npm v3.10.7
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! syscall spawn

npm ERR! fsevents@1.0.14 install: node-pre-gyp install --fallback-to-build
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fsevents@1.0.14 install script ‘node-pre-gyp install --fallback-to-build’.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the fsevents package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-pre-gyp install --fallback-to-build

So it’s becoming obvious.

Whenever deploying or working with a particular Angular project, one must shrink wrap (or save the specific versions of different packages that work together) in order to ensure it works for the next person.

The issue was although the Angular 2 package was working, the server had an issue with the version of Node or NPM that I installed.

I think I will experiment right now.

Although Node.js recommends that I only use Node.js 6.x instead of 7.x, I will try 7.x and see what happens.

But first, I will Google these specific errors I just received and see if I can fix it specifically for the Dreamhost Ubuntu server set up…

I tried “sudo npm start” instead of “npm start” (even though I already have root access!) and it somehow worked with no issues.

I’m tempted to go back to NPM 3.10.10 and see if a “sudo npm start” would work as well.

I git cloned the source code for the angular project (angular.git) instead of the directory.


Angular 2 now works fine on my Dreamhost dedicated machine.

Sweet! Thanks for lettings us know!