Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm install save by default

It happened too many times that I forgot to add --save when installing node modules. Is there a way to append this option by default? So that whenever I type npm install <package> the package is added to dependencies in package.json.

like image 406
Lukasz Wiktor Avatar asked Jun 16 '16 07:06

Lukasz Wiktor


1 Answers

I found out that npm has configuration flags. Setting save=true does exactly what I need. You can add it to .npmrc file (in user's home directory) or invoke a command:

npm config set save=true
like image 123
Lukasz Wiktor Avatar answered Nov 16 '22 04:11

Lukasz Wiktor