Node preliminary recognition

Node

node basic concepts

  1. Node.js is a JavaScript runtime environment Chrome V8 engine
  2. Node.js uses an event-driven, non-blocking I / O model, it lightweight and efficient
  3. Event-driven: tasks performed, publishers, subscribers, event-driven (on emit)
    event-driven: tasks performed, publishers, subscribers, event-driven (on emit)
    non-blocking: while performing certain tasks can also perform other tasks
    blocking: perform a certain task, if the task is not executed, the other tasks must wait
    synchronous
    asynchronous
    I / O: input / output (database operations, file system operations, etc.)
    non-blocking I / O model: when we use Node.js to when implementing operational database operations, file systems, asynchronous operations to be carried out, the core of the traditional implementation is asynchronous operation callback function

node installation

  1. Installation package, the official website to download the corresponding installation package
  2. nvm installation, namely Node Version Manager (Node version management tool)
    Frequently Asked Questions:
    any directory can not be used nvm, nvm only be used in the installation directory, it is the environment variable in question?
    Advanced system variables in the environment variable creates two variables
    1. NVM_HOME
    variable name: NVM_HOME variable value: nvm installation directory path
    2. NVM_SYMLINK
    variable name: NVM_SYMLINK variable value: Node.js installation directory
    in the path path system variables the above-referenced variables created come
    ;% NVM_HOME %% NVM_SYMLINK% added to the rear of the system variable pth path. Remember: Do not delete the path path
  3. Use nvm
    nvm list List the current version of the computer all the Node.js
    nvm install version install a version of Node.js,
    nvm Node.js use one version Version handover
    Node -v
    NPM -v
    If the normal output of more than two , then the switch is successful
    if it is not normal? In other versions to download and install (must be at least 8.9+)
  4. node version of common sense
    even-numbered version is stable version (0.6.x, 0.8.x, 0.10.x)
    odd version of a non-stable version (0.7.x, 0.9.x, 0.11.x)
  5. Common command-line operation in Windows
    to switch the current directory (change directory): cd
    Create a directory (make directory): mkdir
    view the current directory listing (directory): dir
    alias: ls (list)
    clear the current console: cls
    Alias: clear
    deleting files : del
    alias: rm

Guess you like

Origin blog.csdn.net/qq_33721570/article/details/93399693