nodejs 环境配置技巧

 

环境:Mac OSX 10.10.3

NodeJS:v0.12.2

NodeJs 安装指需要

1.执行 npm install xxxx -g 时 需要执行 sudo npm install xxxx -g 否则 会提示Please try this command as root/administrator 

2.安装Package Control 时候 会发现跟Window 上面会有些不一样 是在下图中位置的

 

 

现在安装Zen Coding 需要 command+shift+p ->输入IP->输入EMMET 安装Zen Coding

另外像JsFormat 之类的插件可以自己安装几个试试

3.网上抄来的一小段web服务器代码:

 

var http = require('http');

http.createServer(function(req, res) {
    res.writeHead(200, {
        'Content-Type': 'text/plain'
    });
    res.end('Hello Node.js');
}).listen(8124, '127.0.0.1')

console.log('Server running at http://127.0.0.1:8124');

 

4.npm&bower 安装指令

1 npm install express
2 npm install jade
3 bower install bootstrap

 

posted @ 2015-04-29 16:34  tf.li  阅读(276)  评论(0编辑  收藏  举报