Created
December 30, 2021 14:41
-
-
Save pradeepn/0bd155e464fccab3763fb2aa33dbefe6 to your computer and use it in GitHub Desktop.
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 or update nvm using following curl | |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash | |
//see latest nvm version | |
nvm version | |
//see list of node versions locally installed | |
nvm list | |
//see list of node version available in remote | |
nvm list available | |
//To install x.x.x node version | |
nvm install 17.3.0 | |
//To use a version as default node or make a node version as default | |
nvm use 17.3.0 | |
//check if the defaut version set as expected | |
node --version | |
npm --version | |
//Install package.json dependencies | |
npm install | |
//Shorthand install | |
npm i <package> | |
//Shorthand uninstall | |
npm un <package> | |
// update | |
npm up <package> | |
//Flags | |
-S is the same as --save, and -D is the same as --save-dev. | |
//List globally installed packages | |
npm list -g --depth=0 | |
//Uninstall global package | |
npm -g uninstall <name> | |
//Upgrade npm on Windows | |
npm-windows-upgrade | |
//Update global packages | |
//To see which packages need updating, use: | |
npm outdated -g --depth=0 | |
//To update global packages individually you can use: | |
npm update -g <package> <package> <package> | |
//list available scripts to run | |
npm run | |
//Update npm | |
npm install -g npm@latest | |
//# using windows? Then use | |
npm-windows-upgrade | |
nvm install-latest-npm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment