Node.js环境搭建和学习(windwos环境)
2014-03-28 15:29
555 查看
Node.js环境搭建和学习
一、环境搭建
1、下载安装文件
下载地址http://nodejs-org.qiniudn.com/下载Node.js环境安装包,根据操作系统下载对应的安装包
下载地址 http://www.nodejs.org/download/,选择windows版本即可。
2、安装 将下载的文件双击安装,默认路径是C:\Program Files(x86)\nodejs
3、测试 安装完成后,即可进行测试。
打开cmd,键入node,即可进入nodejs命令。
键入.help,输出如下:
C:\Users\ctid>node
> .help
.break Sometimes you get stuck, this gets you out
.clear Alias for .break
.exit Exit the repl
.help Show repl options
.load Load JS from a file into the REPL session
.save Save all evaluated commands in this REPL session to a file
>
表示安装成功!
二、测试
1、HelloWord
编写一个js文件,命名为HelloWorld.js,内容如下:
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(8887);
console.log('Server running at http://127.0.0.1:8887/');
进入cmd,输入node E:\nodejs\HelloWorld.js,即可看到输出:
Server running at http://127.0.0.1:8887/
在浏览器中输入http://127.0.0.1:8887/,即可看到HelloWord字样。
2.实践操作
当修改了HelloWorld.js文件内容,需要在cmd窗口下,重新输入:node E:\nodejs\HelloWorld.js,
在浏览器中输入http://127.0.0.1:8887/,才能看到修改后的效果
三、推荐几个学习网站
1、http://www.ibm.com/developerworks/cn/web/1201_wangqf_nodejs/ 被误解的 Node.js
2、http://www.cnblogs.com/lhb25/archive/2013/12/05/node-js-tutorials.html Node.js 中文学习资料和教程导航
一、环境搭建
1、下载安装文件
下载地址http://nodejs-org.qiniudn.com/下载Node.js环境安装包,根据操作系统下载对应的安装包
下载地址 http://www.nodejs.org/download/,选择windows版本即可。
2、安装 将下载的文件双击安装,默认路径是C:\Program Files(x86)\nodejs
3、测试 安装完成后,即可进行测试。
打开cmd,键入node,即可进入nodejs命令。
键入.help,输出如下:
C:\Users\ctid>node
> .help
.break Sometimes you get stuck, this gets you out
.clear Alias for .break
.exit Exit the repl
.help Show repl options
.load Load JS from a file into the REPL session
.save Save all evaluated commands in this REPL session to a file
>
表示安装成功!
二、测试
1、HelloWord
编写一个js文件,命名为HelloWorld.js,内容如下:
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Hello World\n');
}).listen(8887);
console.log('Server running at http://127.0.0.1:8887/');
进入cmd,输入node E:\nodejs\HelloWorld.js,即可看到输出:
Server running at http://127.0.0.1:8887/
在浏览器中输入http://127.0.0.1:8887/,即可看到HelloWord字样。
2.实践操作
当修改了HelloWorld.js文件内容,需要在cmd窗口下,重新输入:node E:\nodejs\HelloWorld.js,
在浏览器中输入http://127.0.0.1:8887/,才能看到修改后的效果
三、推荐几个学习网站
1、http://www.ibm.com/developerworks/cn/web/1201_wangqf_nodejs/ 被误解的 Node.js
2、http://www.cnblogs.com/lhb25/archive/2013/12/05/node-js-tutorials.html Node.js 中文学习资料和教程导航
相关文章推荐
- Node.js环境搭建和学习(windwos环境)
- node.js的学习历程一开发环境搭建和helloworld
- Node.js学习笔记1:windows环境搭建
- NodeJS-学习笔记(1)--windows7下node.js环境的搭建
- Node.js学习之IDE环境搭建
- Docker学习之——Node.js+MongoDB+Nginx环境搭建(一)
- Node.js+MongoDB的环境搭建+学习实例
- Node.js学习之环境搭建
- ES6 学习笔记 (2)-- Liunx环境安装Node.js 与 搭建 Node.js 开发环境
- nodejs+ionic+cordova+intellijIdea搭建webApp环境分析
- Vue.js 运行环境搭建详解及vue、node基础知识普及
- 20160110 node.js开发环境搭建
- Node.js学习--搭建一个简单的带有get/post接口的服务
- 建立node.js服务器(使用express搭建Web环境)
- SASS学习系列之(二)--------- SASS,SCSS环境搭建(node-sass)
- node学习笔记_01 环境搭建
- Node.js环境搭建-windows
- 使用Visual Studio Code + Node.js搭建TypeScript开发环境
- nodejs+express搭建电影网站之二 -----具体项目结构 开发环境的建立 测试页面流程跑通
- 利用doker快速搭建node.js运行环境