zoukankan      html  css  js  c++  java
  • Ubuntu 20.04 安装 Node.js

    Installation instructions

    Node.js v14.x:

    # Using Ubuntu
    curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
    # Using Debian, as root
    curl -sL https://deb.nodesource.com/setup_14.x | bash -
    apt-get install -y nodejs

    Node.js v12.x:

    # Using Ubuntu
    curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
    # Using Debian, as root
    curl -sL https://deb.nodesource.com/setup_12.x | bash -
    apt-get install -y nodejs

    Node.js v10.x:

    # Using Ubuntu
    curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
    # Using Debian, as root
    curl -sL https://deb.nodesource.com/setup_10.x | bash -
    apt-get install -y nodejs

    Node.js LTS (v12.x):

    # Using Ubuntu
    curl -sL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
    # Using Debian, as root
    curl -sL https://deb.nodesource.com/setup_lts.x | bash -
    apt-get install -y nodejs

    Node.js Current (v14.x):

    # Using Ubuntu
    curl -sL https://deb.nodesource.com/setup_current.x | sudo -E bash -
    sudo apt-get install -y nodejs
    
    # Using Debian, as root
    curl -sL https://deb.nodesource.com/setup_current.x | bash -
    apt-get install -y nodejs

    Optional: install build tools

    To compile and install native addons from npm you may also need to install build tools:

    # use `sudo` on Ubuntu or run this as root on debian
    apt-get install -y build-essential

    Installation Registry

    npm config set registry https://registry.npm.taobao.org
    npm install nrm

    sudo gedit ~/.npmrc

    registry="https://registry.npm.taobao.org/"
    sass_binary_site="https://npm.taobao.org/mirrors/node-sass/"
    phantomjs_cdnurl="http://npm.taobao.org/mirrors/phantomjs/"
    electron_mirror="https://npm.taobao.org/mirrors/electron/"

    Clean Npm Cache


    npm cache clean -f
        
  • 相关阅读:
    总结前端笔面试遇到的问题——HTML部分
    js中的克隆方法
    js操作cookie
    JS中4种常见的内存泄漏
    html、css、js三者的加载顺序
    js中object定义的几种方法
    关于settimeout的面试题
    css各种居中解决方法
    JS实现继承的几种方式
    将博客搬至CSDN
  • 原文地址:https://www.cnblogs.com/Areas/p/13466392.html
Copyright © 2011-2022 走看看