Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WebStorm, using Node Supervisor (so do not have to restart after each code change)?

I'm using WebStorm as my node IDE and love it overall but I haven't been able to figure out how to use node supervisor when running node through WebStorm. Has anyone gotten this to work? I think I'm just not sure how to pass through the supervisor argument so that it uses this when starting the node file.

like image 624
Rick Avatar asked Aug 29 '12 04:08

Rick


Video Answer


1 Answers

Install supervisor globally: npm install -g supervisor

WebStorm/IntelliJ run configuration for non-debug:

Name: supervisor app.js
Path to node: <same>
Node Parameters: /usr/local/lib/node_modules/supervisor/lib/cli-wrapper.js --exec /usr/local/bin/node --no-restart-on exit
Working directory: <same>
Path to Node App JS File: app.js

These paths are for Mac OS X 10.8 so you'll have to replace the above paths with paths on your machine. Next, you'll be able to run this in debug mode but it doesn't step through the code.

For debugging you can either use the remote debugger or just have a different run target for debugging without using supervisor.

like image 121
Dave Jensen Avatar answered Sep 28 '22 07:09

Dave Jensen