Node.js安装

一直想感受服务器端的javascript编程,看了看Node.js感觉很不错,先来安装一下Node.js的环境吧。

这是官方的安装方法(来源于Github

Installing on Windows

Manual install

The http://nodejs.org/dist/latest/node.exe file is a standalone Windows executable that contains only the last version of Node.js engine.

The http://nodejs.org/dist/npm/ directory contains the latest .zip archive of npm (such as npm-1.1.16.zip when npm v1.1.16 was the latest).

Put node.exe to a clean directory, add that directory to your PATH variable, unpack npm to the same directory, and then you'll be able to run scripts (node scriptname.js) and install modules (npm install modulename) anywhere you want.

按上面的把node放到一个空的文件夹里,然后在系统环境变量里面配置好路径,然后把下载下来的npm也解压到相同的路径。不过运行helloworld出不来。

又google了一下,我是在windows下开发的,下来所写的都是在此环境下的操作:

下载最新的node.js官方程序npm.

和上面的一样将node.exe放到单独的一个文件夹,然后配置好环境变量

把下载下来的npm单独解压到一个文件夹。

打开cmd。进入npm下,进行操作

node cli.js install -gf

成功后会出现提示。

接下来就写一个小程序测试一下吧。

posted @ 2012-12-29 00:50  Princeling  阅读(284)  评论(0编辑  收藏  举报