If you’re running Node on Windows (who isn’t? [don’t answer that]), updating Node.js & NPM to the latest version is a little different than on Linux or OSX. In some ways, it’s easier than you might think.
To update these, the easiest way I have found is to download the latest version of Node.js (NPM is included) from the Node site here. Choose 32bit or 64bit (depending on your setup) and install.
Now if you run “node -v” or “npm -v” you’ll see you have the latest and greatest.
A simple solution instead of deploying your code to apache or IIS is to install a local http server. http-server for Node.js is a fast, easy install and app that will allow you to use any directory as a http://localhost.
Installing this simple http server only takes a few steps:
- Install node.js if you don’t already have installed (from http://nodejs.org)
- In a command prompt / terminal, now run:
npm install http-server -g
(this installs http-server globally so you can access from any folder or directory)
- Now using command prompt or terminal, browser to a folder with some html you want to serve as http. (ie: c:\someproject\).
- Open your browser and visit http://localhost:8080.
You can change port 8080 (the default) to anything using “-p”, so http-server -p 8088 would change your local site to http://localhost:8088
Run http-server –help to see the other options available for running.