npm check package version
local packages:
~$ npm list
globally installed packages:
~$ npm list -g
specific package:
~$ npm list <package>
npm check package version
local packages:
~$ npm list
globally installed packages:
~$ npm list -g
specific package:
~$ npm list <package>
how to install latest version of npm package
//For global packages
npm i -g <package name>@latest
npm i -g express@latest
//For loacal packages
npm outdated
npm update
//Manually updating local packages
npm i <package name>@latest
npm update "react" "react-dom"
install node modules
// Install as a dependency
npm install --save packageName
// OR
npm install --save package1 package2
// OR
npm install --save package@version
// OR
npm i -s packageName
// Install as a dev-dependency
npm install --save-dev package@version
// OR
npm i -D packageName
//Install globally
npm install --global packageName
//OR
npm i -g packageName
// You might need SU access on macos/linux to install globally
npm update package.json version field by code
# From 1.0.0 -> 1.0.1
npm version patch
# From 1.0.1 -> 1.1.0
npm version minor
# From 1.1.0 -> 2.0.0
npm version major
npm package version
// How to increment your project version
Ex: 1.0.0
* npm version patch ---> 1.0.1
* npm version minor ---> 1.1.0
* npm version major ---> 2.0.0
npm version [<newversion> | major | minor | patch | premajor |
preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us