nodejs官网:http://nodejs.org/
nodejs作用:
Node.js is a platform built on Chrome’s JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
Node.js是一个建立在Chrome浏览器的JavaScript运行时容易快速构建平台,可扩展的网络应用程序。Node.js使用一个事件驱动的,非阻塞I/O模型,使得它重量轻,高效,完美的数据密集型实时应用程序运行在分布式设备。
目前最新版下载:http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
[root@localhost tar_gz]# wget -c http://nodejs.org/dist/v0.10.26/node-v0.10.26.tar.gz
[root@localhost tar_gz]# tar zxvf node-v0.10.26.tar.gz
[root@localhost tar_gz]# cd node-v0.10.26
[root@localhost node-v0.10.26]# yum install gcc gcc-c++
[root@localhost node-v0.10.26]# ./configure --prefix=/usr/local/nodejs //通过./configure -help查看支持的编译参数 [root@localhost node-v0.10.26]# make [root@localhost node-v0.10.26]# make install
[root@localhost ~]# /usr/local/nodejs/bin/node -v
v0.10.26
测试:
[root@localhost ~]# ln -s /usr/local/nodejs/bin/node /usr/bin/node
[root@localhost ~]# cat test.js //创建测试文件
console.log(‘Hello World.’);
[root@localhost ~]# node test.js
Hello World.
原创文章,转载请注明。本文链接地址: https://www.rootop.org/pages/2196.html