Move a module from devDependencies to dependencies in npm package.json

npmpackage.json

Is there any short command to move a module from devDependencies to dependencies in package.json?

I find myself always doing this:

npm uninstall <module_name> --save-dev 
npm install <module_name> --save

Is there a shorter approach to this?

Best Answer

If you want to do the opposite (i.e. move a module from dependencies to devDependencies) just do:

npm install <module_name> --save-dev

or shorthand:

npm i <module_name> -D

shorthand to move from devDependencies to dependencies (prod):

npm i <module_name> -P