Skip to content

Instantly share code, notes, and snippets.

@makitocode
Created January 23, 2019 23:39
Show Gist options
  • Save makitocode/fbf2eac1f72078ae5ad579aa556142a5 to your computer and use it in GitHub Desktop.
Save makitocode/fbf2eac1f72078ae5ad579aa556142a5 to your computer and use it in GitHub Desktop.
util npm Scripts
::::: 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