1.

What are the GLOBAL & LOCAL Installation of Dependencies? What command you should use to check already Installed Dependencies Which Are Globally Installed Using Npm?

Answer»
  • GLOBAL Dependencies:- We have to keep all global packages or dependencies into <user-directory>/npm directory. All global dependencies can only be used in the Command Line Interface function into any node.js but it cannot be directly imported using require () into any application. For INSTALLING any global package into Node project globally use -G flag. PLEASE use the following command for installing any Global dependency. 
  • Command :- C:Nodejs_WorkSpace>npm install express -g 
  • LOCAL Dependencies:- Any local package gets installed in the local mode only,ie into Local_modules directory PRESENT in the folder where the node js application is installed or kept. Local dependencies can only be accessed by require() function. For installing the node project into local directory, or installing any local dependency, we have to use the following command:- 
  • Command:- C:Nodejs_WorkSpace>npm install express 
  • We can use following command for fulfilling the above purpose:- C:Nodejs_WorkSpace>npm ls -g 


Discussion

No Comment Found