Node.js环境搭建和学习(windwos环境)
来源:互联网 发布:淘宝正品代购店铺推荐 编辑:程序博客网 时间:2024/06/04 01:11
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 环境搭建
- Node.js环境搭建
- node.js环境搭建
- Node.js环境搭建
- node.js环境搭建
- Node.JS 环境搭建
- Node.js环境搭建
- Node.JS 环境搭建
- Node.js环境搭建
- node.js环境搭建
- Node.js学习之环境搭建
- Node.js学习之IDE环境搭建
- node.js学习(十二、ReactNative开发环境搭建)
- [node.js]环境搭建(windows)
- NDK的Windwos环境搭建
- NDK的Windwos环境搭建
- NDK的Windwos环境搭建
- Oracle 获取本周、本月、本季、本年的第一天和最后一天
- css实现图片转动
- 条款一:*{margin:0; padding:0;},清除有可能的默认脏边距;
- AndroidManifest.xml清单配置文件的相关介绍一
- c++ 中 const_iterator 和 const vector<>::iterator的区别
- Node.js环境搭建和学习(windwos环境)
- 全屏滚动图片网站制作(HTML5+JS+jQuery)——(jQuery篇)
- Intent用法实例
- 全局变量和静态本地变量
- 采集数据
- MySQL的备份与还原
- Dijkstra算法与Prim算法的异同
- CentOS6一键升级GCC4.8
- Genymotion模拟器及其相关虚拟机下载地址