node.js - How to start the Cloud9 debugger with MeanJS -
newbie warning...
i followed tutorial (from freecodecamp) setup new mean.js stack in cloud9. https://vimeo.com/123488494
the tutorial says start application running command:
npm start
which works fine... except debugger doesn't attach , can't use breakpoints, etc.
what magic missing?
figured out on own, sort of (no, didn't take 2 days). here's detailed "whats up" future newbies stumble on this...
the tutorial said start app npm command:
npm start
for reason not yet clear me, npm calls "start script" specified in package.json @ path... /scripts/start (and other stuff... read manual).
the default install had in scripts section:
"scripts": { "start": "grunt", "test": "grunt test", "postinstall": "bower install --config.interactive=false" },
so...
npm start
is fancy way of running...
grunt
grunt "javascript task runner", looks runs javascript in gruntfile.js - populated default install.
gruntfile.js has entry:
nodemon: { dev: { script: 'server.js', options: { nodeargs: ['--debug'], ext: 'js,html', watch: watchfiles.serverviews.concat(watchfiles.serverjs) } } },
at point, grunt firing off node server startup command evidenced output message:
[nodemon] starting `node --debug server.js`
... cloud9 not respecting --debug request reason... many fancy indirections or something.
so did create new cloud9 run configuration (run (menu) > run configurations > new run configuration):
name: debug command: server <<< executes server.js runner: node.js
then can use debug. seem working ok, few minutes @ point. there seem bunch of stuff skipped starting app way... debugger sure come in handy. i'll try use when want debug.
i love learning new technologies... wish faster.
b.t.w. if has better solution or more experienced perspective on this, i'd happy mark response answer!
on edit 2 hrs after posting
another nice side effect of alternate run approach takes way less memory run!!!! no longer warning messages asking me upgrade precious cloud 9 free account.
Comments
Post a Comment