Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Using node option --inspect #932

Closed
azryelryvel opened this issue Jun 16, 2020 · 6 comments
Closed

Using node option --inspect #932

azryelryvel opened this issue Jun 16, 2020 · 6 comments
Labels

Comments

@azryelryvel
Copy link

Hello!

From what i read, I understand that you removed debugging for security reasons, but is there a way to make it work anyway ? I read #93 and I don't think it's up to date anymore.

I ran a node:12.16.1 container and installed pkg locally in it. In node_modules/pkg-fetch/patches/node.v12.16.1.cpp.patch , I removed the node_options.cc block which seemed to me to be the one blocking the use of inspect.
Then i used the local pkg to build the application :
node node_modules/pkg/lib-es5/bin.js path/to/server.js --debug -b -t host --options inspect
But I still get /root/.pkg-cache/v2.6/built-v12.16.1-linux-x64: bad option: --inspect during compilation.
I looked at the node_options.cc file in /tmp/VpJIGdcFfQzWrlk73Sd2/node/src/node_options.cc and i don't see the return I removed, so I guess my patch modification worked but it was not enough ?
Am i missing something to change in the patch ? https://github.com/vercel/pkg-fetch/blob/master/patches/node.v12.16.1.cpp.patch

Or maybe there is already a baked-in way to make it work ? Like NODE_OPTIONS or SIGUSR1 ?

@josiahbryan
Copy link

👍 Curious, did you ever find a way to do this?

@jcyh0120
Copy link

jcyh0120 commented Feb 22, 2021

Need a way to debug my node application with pkg. Anyway possible ways?

@devmondo
Copy link

devmondo commented May 9, 2021

thanks a lot for the awesome work on pkg

yes please, it is really critical to debug applications.

we have tried what was mentioned and it does not even build on windows giving error
Error! Error: spawn patch ENOENT

and this is blocker for us

@hughobrien
Copy link

apt install patch

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

@github-actions github-actions bot added the Stale label Sep 25, 2021
@github-actions
Copy link

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

5 participants