Here is a quick reference guide for basic commands that we can use when dealing with Node and requiring the use of NPM or YARN.
-
Install dependencies from package.json:
npm install == yarn
-
Install a package and add to package.json:
npm install package --save == yarn add package
-
Install a devDependency to package.json:
npm install package --save-dev == yarn add package --dev
-
Remove a dependency from package.json:
npm uninstall package --save == yarn remove package
-
Upgrade a package to its latest version:
npm update --save == yarn upgrade
-
Install a package globally:
npm install package -g == yarn global add package
Top comments (0)