Comments (7)
I forked the project to try to fix this myself, but it doesn't seem to be possible to pass ordered arguments to child_process.spawn
from nodemon.
I don't think the spawn function is the issue.
I think the only issue is that the arguments are sliced, but then they are shifted and unshifted onto different arrays. Any arguments in 'nodemonargs' that get unshifted into 'appargs' will have their order reversed.
See arg parsing here: https://github.com/remy/nodemon/blob/master/nodemon.js#L229
from nodemon.
Well that's just silly of me, forgetting the arrays have a set order. I've fixed the problem and have issued a pull request
from nodemon.
nodemon has this support baked in, so run this:
nodemon --debug server.coffee
The extra params get added on automatically.
On 15 Jan 2012, at 02:49, Tomas Sandven [email protected] wrote:
I'm trying to pass the arguments
--nodejs --debug
to coffee-script through nodemon. This is what I write:nodemon --nodejs --debug -w src -x coffee src/server.coffee
It should work, but unfortunately nodemon is passing the arguments to coffee in the wrong order, giving me this error:
$ nodemon --nodejs --debug -w src -x coffee src/server.coffee 15 Jan 03:47:10 - [nodemon] v0.6.5 15 Jan 03:47:10 - [nodemon] watching: /root/projects/honstreams/server/src 15 Jan 03:47:10 - [nodemon] running --debug 15 Jan 03:47:10 - [nodemon] starting `coffee --debug --nodejs src/server.coffee` node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: unrecognized option: --debug ...Coffee-script doesn't recognize the option
--debug
. The option--nodejs
should come first, so coffee script knows to send the following arguments to node.
Reply to this email directly or view it on GitHub:
#54
from nodemon.
I saw that in the source and tried it, but it doesn't work.
$ nodemon --debug src/server.coffee 15 Jan 10:16:40 - [nodemon] v0.6.5 15 Jan 10:16:40 - [nodemon] watching: /root/foo/bar/server 15 Jan 10:16:40 - [nodemon] running --debug 15 Jan 10:16:40 - [nodemon] starting `node --debug src/server.coffee` debugger listening on port 5858 /root/foo/bar/server/src/server.coffee:2 # Dependencies ^ node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ SyntaxError: Unexpected token ILLEGAL at Module._compile (module.js:427:25) at Object..js (module.js:450:10) at Module.load (module.js:351:31) at Function._load (module.js:310:12) at Array.0 (module.js:470:10) at EventEmitter._tickCallback (node.js:192:40) 15 Jan 10:16:40 - [nodemon] app crashed - waiting for file changes before starting... ^C15 Jan 10:16:42 - [nodemon] exiting
So it's not using the coffee executable. Specifying the executable works no better
$ nodemon --debug -x coffee src/server.coffee 15 Jan 10:20:08 - [nodemon] v0.6.5 15 Jan 10:20:08 - [nodemon] watching: /root/foo/bar/server 15 Jan 10:20:08 - [nodemon] running --debug 15 Jan 10:20:08 - [nodemon] starting `coffee --debug src/server.coffee` node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: unrecognized option: --debug at OptionParser.parse (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/optparse.js:40:17) at /usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:404:29 at Object.run (/usr/local/lib/node_modules/coffee-script/lib/coffee-script/command.js:46:5) at Object. (/usr/local/lib/node_modules/coffee-script/bin/coffee:7:41) at Module._compile (module.js:432:26) at Object..js (module.js:450:10) at Module.load (module.js:351:31) at Function._load (module.js:310:12) at Array.0 (module.js:470:10) at EventEmitter._tickCallback (node.js:192:40) 15 Jan 10:20:08 - [nodemon] app crashed - waiting for file changes before starting... ^C15 Jan 10:20:09 - [nodemon] exiting
No extra stuff being inserted here to help coffee-script debug.
from nodemon.
@remy The automatic --nodejs logic is there, but it's not quite working.
Here: https://github.com/remy/nodemon/blob/master/nodemon.js#L277
program.app
is already set in getNodemonArgs, why does it need to be set again? This line break it because args
in this case contains --debug
first, so program.app
ends up as --debug
and the extension logic doesn't kick in.
Either way though, it is still a good idea to preserve argument ordering. What if someone had a custom exec that had space separated args like nodemon's -w
args? They'd have to pass them in backwards.
Pull request is over here: #55
from nodemon.
I've got a fix working - both to support:
nodemon --debug app.coffee
And
nodemon -x coffee --nodejs --debug app.coffee
I'm just running through some tests to make sure the change is good.
from nodemon.
Related Issues (20)
- Nodemon too slow (with large folders) HOT 1
- V2 to V3 Migration HOT 2
- When I Use Nodemailer to send rest password to email the nodemailer crashed app server and the server are down but the message send HOT 2
- When I Use Nodemailer to send rest password to email the nodemailer crashed app server and the server are down but the message send HOT 3
- Adding copy button to the code given on main website HOT 4
- ⭐ [FEATURE REQUEST] : Add Scroll to Top Button to NODEMON Webpage HOT 3
- FEATURE: Add scroll-up button (Hacktober Fest) HOT 2
- nodemon can't kill process under win10 HOT 5
- Cannot read properties of undefined (reading 'filename') in Node v20.6.0 (yarn2) HOT 7
- nodemon can not be stopped by Ctrl-C with --no-stdin after restart with terminal in raw mode HOT 9
- catch global error not working HOT 1
- ignore everything except repeated specific sub directories HOT 3
- Old version of `debug` dependency introduces `CVE-2017-16137` vulnerability HOT 1
- Workflows failing - not even getting to tests… HOT 2
- I need some assistance. it‘s not a bug but I didn't find the discussion tag. So I have to raise a question as an issue:does nodemon support running ts files? HOT 5
- Issue on a dependency - CVE-2022-25883 HOT 3
- Graceful shutdown of Docker container not respected HOT 6
- Nodemon support for native .env file loading (Remy edit: was always supported) HOT 4
- nodemon called as a subprocess within a subprocess breaks stdin after SIGINT HOT 5
- Nodemon TypeError [ERR_UNKNOWN_FILE_EXTENSION]: Unknown file extension ".ts" HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nodemon.