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
Post a Comment