ioBroker / dev-server

MIT License
14 stars 8 forks source link

My instructions for debugging via remote #429

Closed raschy closed 1 year ago

raschy commented 1 year ago

Inspired by the great demand for a suitable setup, I have written down my settings here. This is not an issue but a possible basis for a documentation. My setting consists of a proxmox-lxc, in which a test adapter was created via Adapter-Creator. The processing is done via ssh from a Windows client via VSC. First, I stored a 'launch.json' from the example here (https://github.com/ioBroker/create-adapter/issues/1059) in VSC under .vscode. I adjusted this until no more errors were displayed.

{ "version": "0.2.0", "configurations": [ { "name": "Launch normal", "program": "${workspaceFolder}/main.js", "args": ["--instance", "0", "--force", "--logs", "--debug"], //"env": {"NODE_PATH" : ".dev-server/default/node_modules"}, "env": {"NODE_PATH" : "${workspaceFolder}/.dev-server/default/node_modules"}, "request": "launch", "stopOnEntry": true, "console": "internalConsole", "outputCapture": "std", "skipFiles": [ "/" ], "type": "node" }, { "name": "Launch install", "program": "${workspaceFolder}/main.js", "args": ["--instance", "0", "--force", "--logs", "--debug", "--install"], "env": {"NODE_PATH" : ".dev-server/default/node_modules"}, "request": "launch", "stopOnEntry": true, "console": "internalConsole", "outputCapture": "std", "skipFiles": [ "/" ], "type": "node" }, { "name": "Attach by Process ID", "processId": "${command:PickProcess}", "request": "attach", "skipFiles": [ "/**" ], "type": "node" } ] }

Additionally, I added the following line to the lxc in .bashrc:

NODE_PATH='/home/raschy/ioBroker.raschytest/.devserver/default/node_modules/'

I then started the dev-server with 'run'. Now I could debug via ssh. Whether all the steps were correct or something could be too much, must be judged by the experts.