Reputation: 6855
I am new at nodejs. This is my first install. I have installed node js on windows 8 and I want to install modules with command
npm install yuicompressor
C:\Users\myname\AppData\Roaming\npm\node_modules
But my nodejs is installed to C:\Program Files\nodejs directory and there is a folder named node_modules in here.
My npm module installation is going to C:\Users\myname\AppData\Roaming\npm\node_modules
is this an issue.
Upvotes: 0
Views: 705
Reputation: 943560
There are two ways to install npm packages: locally or globally. You choose which kind of installation to use based on how you want to use the package.
If you want to depend on the package from your own module using something like Node's require, then you want to install locally. On the other hand, if you want to use it as a command line tool, something like the grunt CLI, then you want to install it globally.
— https://docs.npmjs.com/getting-started/installing-npm-packages-locally
To download packages globally, you simply use the command
npm install -g <package>
— https://docs.npmjs.com/getting-started/installing-npm-packages-globally
Upvotes: 1