Install nodejs on CentOS 7+

  1. 打开 https://github.com/nodesource/distributions#rpminstall

  2. run shell
    `NodeJS 12.x
    curl -sL https://rpm.nodesource.com/setup_12.x | bash -

    NodeJS 11.x
    curl -sL https://rpm.nodesource.com/setup_11.x | bash -

    NodeJS 10.x
    curl -sL https://rpm.nodesource.com/setup_10.x | bash -

    NodeJS 8.x
    curl -sL https://rpm.nodesource.com/setup_8.x | bash -

    NodeJS 6.x
    curl -sL https://rpm.nodesource.com/setup_6.x | bash -
    `

  3. sudo yum install -y nodejs

$ node -v
v10.15.3

你可能感兴趣的:(Linux)