The current windows installer from nodejs.org as of v0.6.11 (2012-02-20) will install NPM along with NodeJS.
npm installas that user. Some modules/utilities should be installed globally.
...\npmdirectory to your users path yourself.
To change the "global" location for all users to a more appropriate shared global location
%ALLUSERSPROFILE%\(npm|npm-cache) (do this as an administrator):
npm config --global ...actions
C:\ProgramData\npm-cache- npm modules will go here
C:\ProgramData\npm- binary scripts for globally installed modules will go here
C:\ProgramData\npm\node_modules- globally installed modules will go here
npm config --global set prefix "C:\ProgramData\npm"
npm config --global set cache "C:\ProgramData\npm-cache"
C:\ProgramData\npmto your System's Path environment variable
If you want to change your user's "global" location to
%LOCALAPPDATA%\(npm|npm-cache) path instead:
C:\Users\YOURNAME\AppData\Local\npm-cache- npm modules will go here
C:\Users\YOURNAME\AppData\Local\npm- binary scripts for installed modules will go here
C:\Users\YOURNAME\AppData\Local\npm\node_modules- globally installed modules will go here
npm config set prefix "C:\Users\YOURNAME\AppData\Local\npm"
npm config set cache "C:\Users\YOURNAME\AppData\Local\npm-cache"
setx PATH "%PATH%;C:\Users\YOURNAME\AppData\Local\npm"
For beginners, some of the npm modules I've made the most use of are as follows.
More advanced JS options...
For testing, I reach for the following tools...
If you build it...
When Node.js is not installed using the msi installer, npm needs to be setup manually.
First, let's say we have the node.exe file located in the folder
c:\nodejs. Now to setup npm-
In order to test npm, open
cmd.exe change working directory to
c:\nodejs and type
npm --version. You will see the version of npm if it is setup correctly.
Once setup is done, it can be used to install/uninstall packages locally or globally. For more information on using npm visit https://docs.npmjs.com/.
As the final step you can add node's folder path
c:\nodejs to the
path environment variable so that you don't have to specify full path when running
npm at command prompt.
I just installed latest version of node (0.6.12) in Windows 7 using msi (node-v0.6.12.msi).
npm is already shipped with it, no need to include it separately.
I was facing permission issue while running npm (npm install mysql), from the path where my nodejs resided, i.e. C:\Program Files (x86)\nodejs
Then I followed below steps:
C:\Program Files (x86)\nodejs\npm in environment variables - Path system variable.
2) went back to only
C:\ in command prompt and gave the command -
npm install mysql - and voila! it worked..
Hope this helps.
I am running node.js on Windows with npm. The trick is simply use cygwin. I followed the howto under https://github.com/joyent/node/wiki/Building-node.js-on-Cygwin-(Windows) . But make sure that you use version 0.4.11 of nodejs or npm will fail!
I've just installed 64 bit Node.js v0.12.0 for Windows 8.1 from here. It's about 8MB and since it's an MSI you just double click to launch. It will automatically set up your environment paths etc.
Then to get the command line it's just
[Win-Key]+[S] for search and then enter "node.js" as your search phrase.
Node.js Command Prompt entry NOT the
Both will given you a command prompt but only the former will actually work. npm is built into that download so then just
npm -whatever at prompt.
Use a Windows Package manager like chocolatey. First install chocolatey as indicated on it's homepage. That should be a breeze
Then, to install Node JS (Install), run the following command from the command line or from PowerShell:
C:> cinst nodejs.install
Here is a guide by @CTS_AE on how to use NPM with standalone node.exe: https://stackoverflow.com/a/31148216/228508
I just installed Node.js for the first time and it includes NPM, which can be ran from the Windows cmd. However, make sure that you run it as an administrator. Right click on cmd and choose "run as administrator". This allowed me to call npm commands.
Search all .npmrc file in your system.
Please verify that the path you have given is correct. If not please remove the incorrect path.