On this page you find all important commands for the CLI tool npm. If the
command you are looking for is missing please ask our AI.
npm
npm is the world's largest software registry. Open source developers from every continent use npm to share and borrow packages, and many organizations use npm to manage private development as well.
Articles in our magazine for npm:
Exploring the Nuxt Command Line
Using the command line is often faster and more effective. Event when using frontend frameworks like nuxt. Here are the most important commands.
List of commands for npm:
-
cypress:install Install Cypress (e2e testing tool)$ npm install cypress --save-devtry on your machineexplain this command
-
npm-fund:tldr:14222 npm-fund: List dependencies with a funding URL for a specific [w]orkspace for the project in the current directory.$ npm fund -w ${workspace}try on your machineexplain this command
-
npm-fund:tldr:28f02 npm-fund: List dependencies with funding URL for the project in the current directory.$ npm fundtry on your machineexplain this command
-
npm-fund:tldr:c6bf7 npm-fund: Open the funding URL for a specific package in the default web browser.$ npm fund ${package}try on your machineexplain this command
-
npm-query:tldr:03071 npm-query: Print all direct production/development dependencies.$ npm query ':root > .${select}'try on your machineexplain this command
-
npm-query:tldr:14133 npm-query: Find all dependencies with postinstall scripts and uninstall them.$ npm query ":attr(scripts, [postinstall])" | jq 'map(.name) | join("\n")' -r | xargs -I {} npm uninstall {}try on your machineexplain this command
-
npm-query:tldr:2644d npm-query: Find all Git dependencies and print which application requires them.$ npm query ":type(git)" | jq 'map(.name)' | xargs -I {} npm why {}try on your machineexplain this command
-
npm-query:tldr:768cb npm-query: Print dependencies with a specific name.$ npm query '#${package_name}'try on your machineexplain this command
-
npm-query:tldr:809a4 npm-query: Print dependencies with a specific name and within a semantic versioning range.$ npm query #${package_name}@${semantic_version}try on your machineexplain this command
-
npm-query:tldr:b69a8 npm-query: Print direct dependencies.$ npm query ':root > *'try on your machineexplain this command
-
npm-query:tldr:e987c npm-query: Print dependencies which have no dependencies.$ npm query ':empty'try on your machineexplain this command
-
npm:init Interactively create a `package.json` file.$ npm inittry on your machineexplain this command
-
npm:module:global:remove-all Remove all global npm modules$ npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rmtry on your machine
-
npm:module:local:remove Uninstall a local NPM package$ npm uninstall ${name}try on your machine
-
npm:modules:install:global List all globally installed NPM packages$ npm list -g --depth=0try on your machineexplain this command
-
npm:package:version Find version of an installed npm package$ npm list ${package_name}try on your machine
-
npm:packages:tree Print a tree of locally installed dependencies.$ npm listtry on your machineexplain this command
-
npm:run:dev Run a npm based application in development mode.$ npm run devtry on your machineexplain this command
-
npm:test:run Execute tests in an npm managed application$ npm testtry on your machineexplain this command
-
npm:tldr:42a3b npm: Download a specific version of a package and add it to the list of dependencies in `package.json`.$ npm install ${module_name}@${version}try on your machineexplain this command
-
npm:tldr:84f19 npm: Download a package and add it to the list of dev dependencies in `package.json`.$ npm install ${module_name} --save-devtry on your machineexplain this command
-
npm:tldr:a8430 npm: Download a package and install it globally.$ npm install --global ${module_name}try on your machineexplain this command
-
npm:tldr:adbd7 npm: List top-level globally installed modules.$ npm list --global --depth=${0}try on your machineexplain this command
-
npm:tldr:d5311 npm: Download all the packages listed as dependencies in package.json.$ npm installtry on your machineexplain this command
-
npm:warp:0ef24 Update NPM to the latest version$ npm update -g npmtry on your machineexplain this command
-
npm:warp:213fc Update each dependency in package.json to the latest version (NPM)$ npm i -g npm-check-updates
$ ncu -u
$ npm installtry on your machineexplain this command -
npm:warp:cd2b6 Install npm package from GitHub directly$ npm install ${repo}#${branch}try on your machineexplain this command
-
nuxt:server:start Start the production server and serve the built application$ npm starttry on your machineexplain this command
-
nuxt:static:generate Generate a static version of your nuxt application$ npm run generatetry on your machineexplain this command
-
vite:tldr:f642f vite: Setup using `npm` 6.x.$ npm create vite@latest my-react-app --template react-tstry on your machineexplain this command
-
yarn:upgrade:latest Upgrade Yarn to latest version$ npm install --global yarn
$ npm upgrade --global yarntry on your machine