Install node.js binary publishing package on CentOS


First, Du Niang found that the articles on the Internet were compiled from the source code, which took a long time, but the official website clearly has the ready-made binary distribution package, and then found the correct way to open the binary package under the download page of the official website.
It is arranged as follows:

  • Find the direct download link of Linux binaries (x64) on the official website and copy it
  • WGet Download
  • XZ decompression
    xz -d node-v10.15.3-linux-x64.tar.xz
  • Tar unpack
    tar -xvf node-v10.15.3-linux-x64.tar
  • The above command is extracted to the current directory and moved to / usr / local / lib / nodejs according to the document

    mv node-v10.15.3-linux-x64 /usr/local/lib
    mv /usr/local/lib/node-v10.15.3-linux-x64/ /usr/local/lib/nodejs
  • Add the bin directory to the path environment variable
    export PATH=/usr/local/lib/nodejs/bin:$PATH
  • Create a hard link

    ln -s /usr/local/lib/nodejs/bin/node /usr/bin/node
    ln -s /usr/local/lib/nodejs/bin/npm /usr/bin/npm
    ln -s /usr/local/lib/nodejs/bin/npx /usr/bin/npx
  • Verify installation

    node -v
    npm version
    npx -v

Recommended Today

Windows server side programming – Chapter 2 device IO and inter thread communication – 8 – the architecture of ports around I / O

Architecture of ports around I / O When the service application is initialized, I / O completion ports are created through functions such as createnewcompletionport. The application also needs to create a thread pool to handle client requests. Now the question is: how many threads should there be in the thread pool? This question is […]