More and more teams are moving their development environments to Docker containers. It brings a lot of advantages, such as a unified environment sh...
For further actions, you may consider blocking this person and/or reporting abuse
"start": "nodemon --inspect=0.0.0.0 source/index.ts",
throws
[nodemon] starting
ts-node --inspect=0.0.0.0 source/index.ts
/app/node_modules/arg/index.js:90
throw err;
^
Error: Unknown or unexpected option: --inspect
any idea how to fix it?
What's your version of nodemon?
Thanks for this helpful guide. I get that you're covering Open-source options here, but another option for getting code-level debug data out of a containerized Node.js app is Rookout.com. It has some interesting advantages over a traditional debugger - it's always on, even in production, and it doesn't stop the app so you can create 'breakpoints' that don't actually break, all without restarting or redeploying. It also works at scale - you don't have to attach it to a single instance in a single container, it can debug across a whole Swarm or Cluster all at once.
On the other hand, it doesn't allow variable forcing or logic forcing, which means it's more limited than a true debugger. Of course, this has some advantages too (safe use on live systems etc).
Have you encountered Rookout before?
You can also start the inspector if the process is already running with:
Where
$pid
is the process identifier of the program you want to debug.Dear Alx,
Your tutorial is great. Why did you add "/usr/src/app/node_modules" in volumes. What is the purpose of it? because "/usr/src/app" contain every thing that we need.
Thank you. In you local machine in app folder you don't have node modules, so when you use mount your folder will override everything in /usr/src/app. The line you mentioned, sort of preventing overriding of node modules installed during the image build process.
You can do the same by adding
node_modules
to a.dockerignore
file. 👍No. dockerignore works only for the process of copying file during the build of the image and has nothing to do with mount.
Impressive, always wanted to "grow up" and stop using console.dir() while developing nodejs apps :)
It's also much faster to debug functionality with debugger rather than using console.log or console.dir
amazing, for the first part before configuring for VS code, will continue reading later :P
Hi done it all and it dont wanna work
Thank you a lot Alex. You just save my day!