Connect Debugger to NPM shell script that runs other repos, in VSCODE - debugging

I am using VSCODE on mac and trying to run a debugger to stop at breakpoints, when running an NPM script.
The NPM script is a shell script (.sh) and it starts a "watcher" on 4 different repos, that form my local server for the project.
The issue is that when I run the debugger on the relevant NPM script (using vscode's 'debug script' option), it seems like VSCODE has a debugger attached, but it never stops at my breakpoints.
The server itself seems to work fine.
I read a lot of answers regarding debugging NPM scripts, but they always refer to a .js file.
Am I not connecting the debugger in the correct way?
Is it possible to debug a shell script that runs this way?
My guess is that the debugger is only connected to the shell script which works fine, but "doesn't know" about the breakpoints in the actual repos that are launched with the script.
Would appreciate any help.
Thank you.

Related

How to Debug python package command line arguments

I have a python package installed on my machine. I could interface with it via the command line. How could I enter my debugger to see the "Call Stack" of the currently running processes that were executed by me from the terminal. Example, running "packagex command --argument" executes a process, I want to see what is happening with this call.
I'm not certain of what to try because the following searches didn't reveal what I am trying to do.
debug a command called from a terminal vscode
debugging an entire package vscode
debug client process vscode
...
It may be that I'm not searching for the correct thing which is why I'm not finding an answer.

How can I run a robot test suite with Windows environment variable using pycharm terminal?

I setup an environment variable in Windows 10 called ROBOT_HOME and it points to my D:\Robot
When I run the test in my PyCharm terminal I use the following command -
robot --test "Example" %ROBOT_HOME%/test-cases
I require these environment variables as it is used company wide and they all call the same ROBOT_HOME and it needs to be defined in each Windows machine locally for it to work.
I am using the Intellibot#master.dev plugin in PyCharm.
It used to work until yesterday (as part of the robot course I'm going through, we used a diff robot framework plugin for PyCharm and now, even reverting back to the previous plugin, it won't work).
I keep getting "File Or Directory does not exist".
When I run the same command in command prompt, it works.
It used to work in the PyCharm terminal as well, not anymore.
In case it's worth mentioning, the PyCharm terminal is Windows Powershell.
In order to call an environment variable from the Powershell terminal in PyCharm, I needed to use the powershell env variable call -
$env:ROBOT_HOME
To see existing variable, can use the following command -
dir env:

rustc disappears when executing cargo run on windows

I am curently developing a Rust program on Windows 10. A few months ago I created a library package using cargo. Since then, I've been developing this program. Whenever I want to execute what I have, I goto to cmd and execute the following command inside my cargo folder:
cargo run --release --bin main
But, a few weeks ago something strange started to happen. Whenever I execute this same command, I notice that the program in fact starts but it finishes preemptively (I know this because of the output to the terminal). When the program finishes it is supposed to write to the terminal "FINISHED". But this never happens. If I execute the command again (without changing the code), this time the only thing that's printed to the terminal is the build message that cargo puts out. Then, when I execute a third time, I have the following message on my terminal:
error: 'cargo.exe' is not installed for the toolchain 'stable-x86_64-pc-windows-msvc'
To install, run `rustup component add cargo --toolchain stable-x86_64-pc-windows-msvc`
Then if I execute the suggested command, I have the following:
component 'cargo' for target 'x86_64-pc-windows-msvc' was automatically added because it is required for toolchain 'stable-x86_64-pc-windows-msvc'
What's weird is that if I execute the previous cargo run command on the Ubuntu terminal application that I have (it simulates a linux terminal, but I am still on my windows file system), this problem doesn't occur. I can execute 100 or 1000 times and no problems. But this isn't good, since my program creates a multi threaded environment and my Ubuntu terminal is like a virtual machine, so I don't believe that I have access to all of my laptop's memory.
Currently I have the following version of rust on windows and my ubuntu terminal:
rustup 1.18.3 (435397f48 2019-05-22)
What I have been doing until now to solve this is on my windows is to reboot my computer and reinstall rust, since when I execute "rustup self uninstall" sometimes an error of not having permissions to install it appears (I only have 1 user on my pc and supposedly I have admin privileges).
I have googled this situation, but I haven't found anything regarding rustc disappearing when executing cargo run. Now I can't even run my program on windows cmd, since this problems happens every time.
The problem was the anti virus I had on my PC.
After replacing it the program is working perfectly and finishing without the problem I had with rustc.

How to kill server via terminal in VS Code?

Our local Macs are set up to run our local server via grep serve
When running from standard terminal, that command builds the project then spins up the local server. To kill it, I can use the break command (command-.).
We're doing a lot more in VS Code now which has the great feature of Terminal built in. However, it appears the command-. doesn't apply to that version of the terminal. So I'm at a bit of a loss...how does one stop the server via the terminal in VS Code?
Crtl+c should kill the currently running process in your terminal (VSCode or otherwise).

Meteor debug on server side on windows with node-inspector

I am running meteor on Windows, possibly a minority here. I searched and found solutions for Linux and possibly Mac but no one has provide solutions for Windows. Maybe someone can help?
First I modified the meteor.bat file under C:\Program Files (x86)\Meteor to included --debug as mentioned in other posts:
#echo off&&"%METEOR_PATH%\bin\node.exe" --debug "%METEOR_PATH%\app\meteor\meteor.js" %*
I started my node-inspector and received an instruction to visit 0.0.0.0:8080/debug?port=5858 to start debugging
I then started my meteor application, but when I go to http://127.0.0.1:8080/debug?port=5858 I saw two squares: one for Scripts, and one for console. Nothing came up when selecting Scripts.
Does Windows have the same issue as Linux, spawning two processes but only one with the debug flag?
Version 0.5.3 added the NODE_OPTIONS environment variable that passes those parameters directly to node.
So fire-up your favorite js debugger like node-inspector
Assuming you already have it installed, call
node-inspector
Then
set NODE_OPTIONS = --debug
meteor
Do this inside your project folder, you can also use the --debug-brk to break immediately on start
In Chrome open localhost:8080 in a new tab
Have fun

Resources