ubuntu下nodejs环境搭建

#0.0.0.0 account.jetbrains.com”添加到hosts文件中

  1. apt-get升级 sudo apt-get upgrade

  2. apt-get更新 sudo apt-get update

  3. 安装node sudo apt-get install nodejs

  4. sudo apt-get install nodejs-legacy

  5. 安装npm sudo apt-get install npm

  6. 安装node管理工具 npm i -g n

  7. 升级node到最新稳定版本 n stable

  8. 升级npm sudo npm i -g npm

  9. 如果版本太低无法安装n模块 使用指定原安装node

    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -sudo apt-get install -y nodejs

原文地址:https://www.cnblogs.com/jiashengyang/p/9347513.html