-
-
Save makitocode/fbf2eac1f72078ae5ad579aa556142a5 to your computer and use it in GitHub Desktop.
util npm Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
::::: Install packages | |
//Install Global package | |
$ npm install -g {packageName} | |
//Install local package | |
$ npm install {packageName} | |
//Install and save local package | |
$ npm install {packageName} --save | |
//Install and save DEV local package | |
$ npm install {packageName} --save-dev | |
::::: Uninstall packages | |
//removes the module from node_modules, but not package.json | |
npm uninstall {packageName} | |
//uninstall package globally also removes it from dependencies in package.json | |
npm -g uninstall {packageName} --save | |
//removes it from dependencies in package.json | |
npm uninstall <name> --save | |
//also removes it from devDependencies in package.json | |
npm uninstall <name> --save-dev | |
:: npm | |
//Audit packages | |
$ npm audit | |
//Audit and fix packages | |
$ npm audit fix | |
//list of node packages installed globally | |
$ npm list -g --depth 0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment