node.js few basic commands

Use the command

Blue is used to command
xxx is the module name

  • node -v        detect the installation was successful
  • node server.js  the command line to run a file called server.js (write your own)
  • npm install xxx    download package
  • npm uninstall xxx Delete package
  • npm init    initialization package.json
  • -f the Clear Cache npm -------- Clear Cache
  • the install XXX -g NPM -------- packet into the global environment
  • XXX --save the install NPM - mounted simultaneously, the information is written in the item path package.json
  • npm view xxx View node modules folder package.json
  • npm list to view the current directory installed node package
  • npm help see the help command
  • npm view xxx dependencies View Dependencies package
  • npm view xxx repository.url view the packet's source address file
  • npm view xxx engines view the package depends on the version of Node
  • npm help folders to see all folders using npm
  • npm rebuild xxx reconstruction after the package contents for change
  • npm outdated check whether the package is already out of date, this command lists all outdated package, the package can be updated in a timely manner
  • npm update xxx update node module
  • npm search xxx publish a npm package when you need to check a package name already exists
  • npm root view the current installation path package
  • npm root -g view the installation path of the overall package
  • npm install --global nrm installation NRM
  • nrm --version detection installation
  • nrm test detection mirror source address
  • nrm use taobao switching mirroring
Published 63 original articles · won praise 6 · views 1187

Guess you like

Origin blog.csdn.net/qq_44163269/article/details/105031665