Skip to content

Instantly share code, notes, and snippets.

@rayrfan
Last active October 10, 2018 17:23
Show Gist options
  • Select an option

  • Save rayrfan/96aba88e3665eb8410002b5a5120d440 to your computer and use it in GitHub Desktop.

Select an option

Save rayrfan/96aba88e3665eb8410002b5a5120d440 to your computer and use it in GitHub Desktop.
npm commonly used cmds

To remove global npm packages, delete C:\Users\username\AppData\Roaming\npm C:\Users\username\AppData\Roaming\npm-cache

# download and install latest nodejs https://nodejs.org/en/
# update to latest npm
$ npm i -g npm@latest
# Shows the latest version of a package named typings
$ npm show typings version
# I like to keep my global package clean
# Shows my global packages
$ npm ls -g --depth=0
# Shows my global outdated packages
$ npm outdated -g
# the typings has been deprecated, to install typings for a lib, say https://www.npmjs.com/package/jwt-decode
$ npm install --save @types/jwt-decode
# if you run into npm ERR pointing to Cached binary found when you do npm i
# https://docs.npmjs.com/troubleshooting/try-clearing-the-npm-cache
# https://docs.npmjs.com/cli/cache
$ npm cache clean --force
# Since I don't need typings anymore, uninstall it
$ npm uninstall -g typings
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment