Theme by nostrich (modified).

17 September 2010 17:51

Installing nodejs on cygwin using nvm

Previously, I showed you how to setup node.js on Ubuntu, and hopefully OSX at the same time.

I recently needed to do some hacking on this blog on Windows, so I needed to install node on my Windows machine. Historically this hasn't been very straightforward, but using cygwin it's now possible, and even fairly easy to achieve. Don't expect *nix-like performance though, a lot of the APIs that make node so fast run a lot slower when they have to pass through cygwin's libraries.

To be honest, the majority of the steps for doing this were found in this blog post on installing node.js on windows, but I found I needed to do a few more steps to get my installation to work.

  1. First off, setup cygwin packages as in the above article
  2. Install the following packages in addition to these:
    • openssl 'devel' (I had issues installing nvm without them)
    • git
    • vim (I like to use this to edit text files without leaving the command window, but feel free to choose your own poison)
  3. Install nvm
  4. This is an important step. For me installing nvm put the .vnm folder into the wrong location. Using Windows Explorer (not the cygwin command prompt) copy the .nvm folder from C:\home\ folder to C:\cygwin\home\
  5. Close all cygwin windows and Start->Run c:\cygwin\bin\ash.exe
  6. In ash, run \bin\rebaseall
  7. Now in a new cygwin window you should find nvm install v0.2.0 should work, following which node should work
  8. To get npm installed and running, you will ned to edit /etc/resolv.conf as per these instructions

Now the npm installation should work, and you should be able to pick up my previous steps from there.


Tagged: nodejswindows

View the discussion thread.blog comments powered byDisqus