?Table of contents
Command Description; npm i: Alias for npm install: npm install: Install everything in package.json: npm install -production: Install everything in package.json, except devDependecies. Cheat Sheet — What you need to know. Npm install yarn Install is the default behavior. Npm install taco -save yarn add taco The Taco package is saved to your package.jsonimmediately. Npm uninstall taco -save yarn remove taco —-savecan be defaulted in NPM by npm config set save true but this is non. Misc features # Add someone as an owner npm owner add USERNAME PACKAGENAME # list packages npm ls. Command Description; npm list: Lists the installed versions of all dependencies in this software: npm list -g -depth 0. Much like Homebrew, npm has a doctor command. It will confirm the following: Node.js and git are executable by npm. The primary npm registry is available. The directories used by npm exist and can be written by the current user. The npm cache exists, and the package tarballs within it aren’t corrupt. Skip-npm (Does not run npm commands after project creation)-skip-git (Does not initialize the repo as a git repo-dire ctory (Specify the parent directory when creating the project) Exam ples: ng new MyProject ng new MyProject -dire ctory c:/Rep os/ Ang ular ng init MyProject -skip -git Generating Code.
A buttercup. Configure xdebug xampp phpstorm. Few commands I found very useful during development.
Command | Description |
---|---|
npm list | show a tree of every package found in the current folder |
npm list -g | same as above ^^, but search also in global packages |
npm list -g --depth=0 | same as above ^^, but do not show every package’s dependencies |
npm list [package name] | show a tree of every instance found in the current folder of that specific package |
npm install | install all packages in package.json |
npm install [package name] | install a package |
npm install [package name] --save | install a package as dependency |
npm install [package name] --save-dev | install a package as dev dependency |
npm uninstall [package name] | uninstall a package |
npm install --save username/repo#branch-name-or-commit-or-tag | install package from GitHub repository |
Alias #
Alias | Command |
---|---|
npm i | npm install |
npm i [package name] -D | npm install [package name] --save-dev |
Npm Commands List
⚡️ Bonus tip #
Npm Run Command
npm-check is a useful tool to check for outdated, incorrect, and unused dependencies
? More info