Debugging NodeJS application with WebStorm
2012-04-24 17:37
417 查看
文章出处:http://blog.zakkum.com/?p=63
注意:刚开始用webstorm debug nodejs的时候,总会出现一个端口一会儿能用,一会不能用的情况。
其实你的debug设置可能没有问题,出问题的是你已经监听的端口没有断开!
I would like to show you how to debug your nodejs web server applications. I’m using JetBrains’ WebStorm for some time and it’s my favourite web development tool for linux box. It’s 2.1 version. There is a nodejs plugin for debug operation in WebStorm. You
can search and install plugin from File->Settings->Plugins window.
I assume that you have installed nodejs and express already. You can grab nodejs from https://github.com/joyent/node and follow installation instructions. It’s
quite easy. Then you can install express with
There is a “Hello world” application to test our server. Create a new javascript file and name it “app.js”
Click Run->Debug… or press alt+shift+f9 to open debug configuration screen. Click plus icon and then click nodejs option.
Give a name to your configuration. Enter your node path (get node path from terminal: which node) and type your app.js file path.
Now we are all set for debugging. Hit the debug button or press shift+f9 and you will see “debugger listenin on port …” message in console. You can make breakpoints to debug your application.
注意:刚开始用webstorm debug nodejs的时候,总会出现一个端口一会儿能用,一会不能用的情况。
其实你的debug设置可能没有问题,出问题的是你已经监听的端口没有断开!
I would like to show you how to debug your nodejs web server applications. I’m using JetBrains’ WebStorm for some time and it’s my favourite web development tool for linux box. It’s 2.1 version. There is a nodejs plugin for debug operation in WebStorm. You
can search and install plugin from File->Settings->Plugins window.
I assume that you have installed nodejs and express already. You can grab nodejs from https://github.com/joyent/node and follow installation instructions. It’s
quite easy. Then you can install express with
npm install -d express
There is a “Hello world” application to test our server. Create a new javascript file and name it “app.js”
var app = require('express').createServer(); app.get('/', function(req, res){ res.send('Hello world'); }); app.listen(3000); console.log('Server started on port 3000');
Click Run->Debug… or press alt+shift+f9 to open debug configuration screen. Click plus icon and then click nodejs option.
Give a name to your configuration. Enter your node path (get node path from terminal: which node) and type your app.js file path.
Now we are all set for debugging. Hit the debug button or press shift+f9 and you will see “debugger listenin on port …” message in console. You can make breakpoints to debug your application.
相关文章推荐
- WebStorm运行Node.js文件报错:runnerw.exe: CreateProcess failed with error 2
- Node.js – Debugging with node-inspector
- [label][IDE] Develop Node.js Project With WebStorm
- Node.js : Using Promises with mongoosejs
- 自学Node.js: WebStorm+Node.js开发环境的配置
- 自学Node.js: WebStorm+Node.js开发环境的配置
- Mastering Web Application Development with AngularJS-Packt 2013 读书笔记(不错的好书!)
- Understanding Asynchronous IO With Python 3.4's Asyncio And Node.js
- nodejs jquery下载本地文件 webstorm
- 自学Node.js: WebStorm+Node.js开发环境的配置
- 自学Node.js: WebStorm+Node.js开发环境的配置
- [Node.js] Test Node RESTful API with Mocha and Chai
- nodejs redis with kue module init
- WebStorm+Node.js开发环境的配置
- [NodeJS] Deploy a Node Application with the Now CLI
- 自学Node.js: WebStorm+Node.js开发环境的配置
- Node Sass could not find a binding for your current environment: Windows 64-bit with Node.js 7.x
- Mastering Web Application Development with AngularJS 读书笔记(一)
- Node.js入门学习笔记-IDE选择/配置之WebStorm(windows)
- Building real time app with Socket.io and Node.js