// 安装4.x版本稳定版,现在为v4.4.7LTS curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs
// 安装6.x开发版,现在为v6.0.3current curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo 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: sudo apt-get install -y build-essential
// 测试是否安装成功: // 新建文件server.js var http = require(‘http‘); http.createServer(function (request, response) { // 发送 HTTP 头部 // HTTP 状态值: 200 : OK // 内容类型: text/plain response.writeHead(200, {‘Content-Type‘: ‘text/plain‘}); // 发送响应数据 "Hello World" response.end(‘Hello World\n‘); }).listen(8888); // 终端打印如下信息 console.log(‘Server running at http://127.0.0.1:8888/‘);
安装nodejs最新版到debian,ubuntu,mint系统
原文:http://www.cnblogs.com/iamhenanese/p/5686608.html