Install, run, manage and publish — the npm commands you use every day. Tap to copy.
npm initCreate a package.json interactivelynpm init -yCreate a package.json with defaultsnpm installInstall all dependencies from package.jsonnpm install <pkg>Add a package as a dependencynpm install -D <pkg>Add a package as a dev dependencynpm install -g <pkg>Install a package globallynpm uninstall <pkg>Remove a packagenpm startRun the start scriptnpm testRun the test scriptnpm run <script>Run a custom script from package.jsonnpm run buildRun the build scriptnpx <pkg>Run a package binary without installing itnpm updateUpdate packages within allowed rangesnpm outdatedShow packages with newer versions availablenpm list --depth=0List top-level installed packagesnpm auditCheck dependencies for known vulnerabilitiesnpm audit fixAutomatically fix vulnerable dependenciesnpm cache clean --forceClear the npm cachenpm loginAuthenticate with the npm registrynpm version patchBump the patch version and tag itnpm publishPublish the package to the registrynpm packCreate a tarball without publishingWhether you're starting a project with npm init, adding packages with npm install, running tasks with npm run, or shipping with npm publish, these are the commands that come up constantly. npx is the handy one people forget — it runs a package's binary without installing it.