[转]各种系统安装Node.js
2011-02-21 16:17
453 查看
下面分别介绍在Mac, Ubuntu,Centos以及Windows下安装Node.js.
否则,只能考虑手工安装了,步骤如下:
安装Xcode
安装git
运行下面的命令行编译node.js
运行下面的命令行:
安装cygwin
在cygwin的目录下,运行setup.exe安装下面列表中的包
devel → openssl
devel → g++-gcc
devel → make
python → python
devel → git
运行cygwin
运行下面的命令行:
Mac
在Mac下,如果你喜欢用homebrew,那么只用一行就可以装好:brew install node
否则,只能考虑手工安装了,步骤如下:
安装Xcode
安装git
运行下面的命令行编译node.js
git clone git://github.com/ry/node.git cd node ./configure make sudo make install
Ubuntu
安装依赖包sudo apt-get install g++ curl libssl-dev apache2-utils sudo apt-get install git-core
运行下面的命令行:
git clone git://github.com/ry/node.git cd node ./configure make sudo make install
Windows
用cygwin来安装node,步骤如下:安装cygwin
在cygwin的目录下,运行setup.exe安装下面列表中的包
devel → openssl
devel → g++-gcc
devel → make
python → python
devel → git
运行cygwin
运行下面的命令行:
git clone git://github.com/ry/node.git cd node ./configure make sudo make install
Centos
yum install gcc-c++ openssl-devel wget --no-check-certificate https://github.com/ry/node/tarball/v0.3.3 tar -xzvf ry-node-v0.3.3-0-g57544ba.tar.gz cd ry-node-v0.3.3-0-g57544bac1 ./configure make make install
Hello Node.js!
写一段小程序例如hello_node.js来验证安装是否正确:var http = require('http'); http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Node.jsn'); }).listen(8124, "127.0.0.1"); console.log('Server running at ' target='_blank'>http://127.0.0.1:8124/');[/code] 用node来运行这段代码node hello_node.js Server running at http://127.0.0.1:8124/[/code] 现在,用浏览器打开 http://127.0.0.1:8124/ , 应该能够看到一条好消息。参考文档
How to Install Node.jsUpdate
补充了在centos上安装Node.js的步骤
相关文章推荐
- Node学习笔记——Linux系统下安装Node.js
- 【图文】Ubuntu系统源码方式编译安装node.js以及express安装出现找不到命令的问题
- window系统安装node.js以及环境搭建
- Linux CentOS 系统安装最新版本Node.js环境及相关文件配置
- Linux CentOS6系统安装最新版本Node.js环境及相关文件配置
- Windows系统下安装Node.js的步骤图文详解
- Linux CentOS6系统安装最新版本Node.js环境及相关文件配置-实测
- Windows系统下node.js的安装与配置
- Windows系统下安装Node.js的步骤图文详解
- centos安装node.js的各种环境
- Centos7 系统下node.js+Nginx+MongoDB的安装与配置
- 在linux系统上安装使用node.js
- node.js在windows系统上安装
- Linux CentOS6系统安装最新版本Node.js环境及相关文件配置
- Node.js安装及环境配置之Windows篇 一、安装环境 1、本机系统:Windows 10 Pro(64位) 2、Node.js:v6.9.2LTS(64位) 二、安装Node.js步骤
- node.js 安装 步骤(记录) 系统版本:腾讯云CentOS6.5
- Linux CentOS6系统安装最新版本Node.js环境及相关文件配置
- Linux CentOS6系统安装最新版本Node.js环境及相关文件配置
- CentOS6系统安装最新版本Node.js环境及相关文件配置
- Windows系统下安装Node.js(2)