Installing NodeJS on Windows is rather simple. Visit the NodeJS website and download the MSI Installer. Run the installer and then come back to this tutorial.
Once NodeJS is installed both the
npm commands should be available on the command line. Verify this by starting a command terminal and executing the following.
C:\Users\mathew>node -v v0.12.4 C:\Users\mathew>npm -v 2.10.1
NodeJS is installed on Windows in the
c:\Program Files\nodejs folder, but the npm modules are installed to the
c:\Users\<your name>\AppData\Roaming\npm. The Windows installer for NodeJS does not add this folder to the PATH environment variable. So when you install new npm modules as global tools they will not be found.
To resolve this issue you need to manually add this path.
- Click File Explorer to open the files browser.
- Right-Click on This PC (on Windows 7 this is called My Computer) and select Properties.
- Select Advance system settings from the side menu.
- Click the button labelled Environment Variables.
- Find the Path variable in the system variables list.
- Add the path
;c:\Users\<your name>\AppData\Roaming\npmto the end of the variable.
Replace the your name part of the path with the Windows user name, and also make sure you place a
;to separate between paths.
If you already have NodeJS installed on Windows 8. Review the above steps to ensure the system path is setup correctly. Otherwise installing global npm modules might not work correctly.
The following commands will install both bower and grunt.
C:\>npm install -g bower grunt grunt-cli C:\>bower -v 1.4.1 C:\>grunt --version grunt-cli v0.1.13
You have to install
grunt-cliseparately on Windows 8 otherwise the
grunt.cmdwon’t be found in the npm folder.