前言
Node.js 是一个基于 Chrome V8 引擎的运行在服务端的 JavaScript 运行环境。
Node.js 使用了一个事件驱动、非阻塞式 I/O 的模型,使其轻量又高效。
安装
安装node.js
从官网https://nodejs.org/en/下载最新的LTS版本
- macox下用过brew安装
brew install homebrew/versions/node6-lts
echo 'export PATH="/usr/local/opt/node@6/bin:$PATH"' >> ~/.bash_profile
安装Nodeclipse CLI
$ npm install -g nodeclipse
$ npm install -g express@3.5.0
$ npm install -g express-generator
$ npm install -g coffee-script
$ npm install webpack -g
$ npm i -g yarn
安装 Enide 2015 包含所有Nodeclipse插件
方式一:
Start Eclipse, then select Help > Install New Software…
Enter the update site URL into the Work with text box:
http://www.nodeclipse.org/updates/
安装后重启,通过Window -> Open Perspective -> Other … -> Node切换到node模式
- 方式二:
下载https://raw.github.com/Nodeclipse/eclipse-node-ide/master/ENodeIDE.p2f
打开eclipse–》File–》Import–》Install–》Install Software Items from file
Chrome安装插件JetBrains IDE Support
离线下载插件,拖拽该文件到chrome浏览器安装
调试
用inspect调试
Node.js自带debugger 调试器
用eclipse调试
在原有nodejs工程目录下执行
nodeclipse -p
其他类型工程或目录,执行
nodeclipse -g