You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does foo.js spawn another process? If so the child_process will also try to start a version of the inspector, and you'll get the address in use error. Command line options don't propagate to child processes by default, environment variables do.
However I'm not able to use the inspector through NODE_OPTIONS in 6.12.0:
▶▶▶ nvm use 6 ~/tmp 1s
Now using node v6.12.0 (npm v3.10.10)
▶▶▶ NODE_OPTIONS=--inspect-brk node t.js ~/tmp 1s
node: --inspect-brk is not allowed in NODE_OPTIONS
Activity
gibfahn commentedon Dec 4, 2017
Does
foo.jsspawn another process? If so the child_process will also try to start a version of the inspector, and you'll get the address in use error. Command line options don't propagate to child processes by default, environment variables do.However I'm not able to use the inspector through
NODE_OPTIONSin 6.12.0:is it working for you?
ORESoftware commentedon Dec 4, 2017
@gibfahn ahh good thinking. so actually I am using
ts-nodeto transpile TypeScript to JS on the fly.so you can do:
ts-node --inspect-brk foo.tsand that flag will be passed to the node executable by ts-node, and this one works!
but if I do
NODE_OPTIONS="--inspect-brk" ts-node foo.tsthis one gets the
error.
so maybe ts-node is spawning a child process, as you say. I am going to cross-contaminate this thread to see if I can get @blakeembrey on the line.
TypeStrong/ts-node#471
[-]How to use inspect-brk with NODE_OPTIONS[/-][+]How to use --inspect-brk with NODE_OPTIONS[/+]