How to install a node module locally and globally? How to add them into package.json?

 By default, Node.js installs the module locally in the ./node_modules directory. To install a module globally and to make them available everywhere, we need to include the -g flag.

npm install express -g

To save the installed module to the package.json under dependencies, add --save flag with the package name. To add under deveDependencies add --save-dev.

Comments

Popular posts from this blog

What test framework did you use to test your nodejs applications

What is V8 Engine? What is the relationship between Node.js and V8?