Sunday, 8 September 2013

Where do npm background scripts go?

Where do npm background scripts go?

I have a program which relies on another program being run so I added this
build command to my package.json file
"scripts": {
"start": "brunch watch --server",
"build": "coffee server/modules/events/book_server.coffee &"
}
so before I run my main script with npm start I run npm run-script build
which makes my main script work, however when I quit my main script and
then look for background processes with bg I get the message
> -bash: bg: current: no such job
so I decided to run npm run-script build again however the previous
process must still have been running because I got the error message
events.js:66
throw arguments[1]; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:776:11)
at Server._listen2._connectionKey (net.js:917:26)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)
and when I tried to run my main program again I got the error
> TypeError: Cannot read property 'port' of null
My question is, where are these background scripts?
So far I have looked in all the obvious places including package.json's
directory the directory for book_server.coffee and in node_modules but
with no luck.

No comments:

Post a Comment