使用sublime text 开发node.js

http://blog.csdn.net/jwkfreedom/article/details/8450005node

本机环境: windows7 64位git

1. 下载安装sublime text,github

不用注册便可彻底使用,只是偶尔弹框提示购买,彻底能够忍受。npm

2. 在sublime text下按 Ctrl+Shift+pwindows

在输入框里输入install, 而后选择Package Control: Install Packageapp

3. 在接下来的对话框中输入nodejsdom

我这里已经安装过nodejs相关插件,因此没有显示相关插件。若是没有安装过,会显示nodejs相关插件,请所有安装。ui

4 把build环境设定为nodejsthis

在Sublime Text 2菜单 -->Tools-->Build System -->Nodejs .net


5. 配置环境

 Preferences-->Package Setting-->Nodejs-->Default 

个人配置:

 

[plain]  view plain copy
 
  1. {  
  2.   // save before running commands  
  3.   "save_first": true,  
  4.   // if present, use this command instead of plain "node"  
  5.   // e.g. "/usr/bin/node" or "C:\bin\node.exe"  
  6.   "node_command": "C:\\Program Files\nodejs\node.exe",  
  7.   // Same for NPM command  
  8.   "npm_command": "C:\\Program Files\nodejs\npm.cmd",  
  9.   "expert_mode": true,  
  10.   "ouput_to_new_tab": false  
  11. }  

6. 编辑好代码后,Ctrl+b 运行。

 

 

运行成功后,若是想中止服务,能够在Tools->Cancel Build来中止服务

附:node.js的简单代码:

======================

调试插件

https://github.com/houfeng0923/NodejsDebug

=================

cmd node-debug app.js

相关文章
相关标签/搜索