DEV Community

Power_Coder
Power_Coder

Posted on • Updated on

Quick Read of All npm Commands.



  • npm init - Interactively creates a package.json file for your project.
  • npm install - Installs all the dependencies listed in the package.json file.
  • npm uninstall package-name - Removes a package from your project.
  • npm update - Updates the packages listed in your package.json file to their latest compatible versions.
  • npm search package-name - Allows you to search for packages in the npm registry.
  • npm list - Shows a list of installed packages and their versions.
  • npm outdated - Lists packages that are outdated compared to the latest available versions.
  • npm run script-name - Executes a script defined in the scripts section of your package.json file.
  • npm publish - Publishes your package to the npm registry if you're the author or maintainer of a package.
  • npm login - Logs you in to your npm account. Required before publishing a package.
  • npm logout - Logs you out of your npm account.
  • npm version - Increments the version number in your package.json file based on a specified versioning strategy.
  • npm config - Allows you to view and set npm configuration options.
  • npm cache clean - Clears the npm cache.
  • npm link - Creates a symbolic link between a globally installed package and a local package.
  • npm root - Shows the path to the global or local package installation directory.
  • npm ls - An alias for npm list.
  • npm dedupe - Attempts to reduce the duplication in the installed packages to save disk space.
  • npm audit - Checks your project for vulnerabilities in its dependencies.
  • npm doctor - Helps diagnose common issues with your npm configuration.



Top comments (0)