I've been trying to figure out how to setup vs code so that I can develop for my Banana Pi.
As it stands now I have my project locally on my PC (window 10) and have built a very basic shell to my app. Now I need to get it moved over to the Pi so that I can start to interact with the hardware.
I've come across a few postings all of which have drastically different directions, from using the "Remote VS Code" extension to more node related stuff, to stuff built into VSCode. I've headed down the path of working on the launch.json
and came across this post on Medium
This seems mostly accurate but based on the intellisense i'm offered from VSCode, it would also appear that this is old and no longer of value. (A large chunk of the options aren't valid anymore it seems)
This seemed pretty useful and at least a lot more accurate to what VS Code currently offers. However, I'm a bit of a noob when it comes to node (and development in general) so this page isn't as helpful as I would like it to be. From what I can tell there are a couple of parts to this problem.
- Get the code from my local workstation to the Pi
From what I've read it seems both the Launch
and Attach
configurations support the RemoteRoot
and LocalRoot
so it feels like either will work for this? It did say that the process was more of a stream from the remote to the local, which is backward from what I have but would be easy enough to do an initial copy there.
- Getting the app running
I feel like this is where the Launch configuration comes in? From what I can tell the important properties would be:
runtimeExecutable
= nodemon (seems ideal for this)program
= ${workspaceFolder}api/api.js (app entry point, this is where package.json points)address
= 192.168.2.7 (banana pi's USB IP)
- Attaching the debugger This part should be covered by the creation of the Attach configuration in part 2. From the MSDN page, it seems like VS Code can take advantage of Node's Inspector option, but I couldn't find anywhere if I needed to supply that as an argument someplace or it was injected automatically by VS Code. It seems like the protocol property on the Attach configuration might do it?
I haven't actually run anything yet because of I'm too scared of screwing up the whole project.
Any direction would be greatly appreciated. Thanks, Justin