How to add modules in Visual Studio
Let’s try to add a new module express which is used to create MVC application using Node.To add a new module, we have 2 options:Using
1.) Node.js command line tool:
Navigate to project Root in command window.
Run below command:
Npm install express
Once installed you can see package in visual studio under npm folder also you can see package.config remains unmodified.
Also we can install using below command:
Npm install express –Save
This will install and also add a new entry in package.json file as below
To install a package as a dev dependeny use below command:
Npm install express –Save-dev
This command will install module as a dev dependency which means that it will not be used in production environment but rather will be used as a development module only.
To install a package globally use below command:
Npm install express –Save g
This command will install module globally
This is how a visual studio project looks like after trying all above commands
In next article we will see the easier approach of adding modules using Visual studio