Posted on

Using Visual Studio Code with a Raspberry Pi (Raspbian) | thisDaveJ

We’re back with our LTM (Learning through Making) series of Node.js tutorials and we’re gearing up and getting ready to write some code!  We’ve learned how to build a Raspberry Pi from the ground up including Node.js, we’ve created a web server in Node without code, and we’ve even managed to get this web server on the Internet as a cool trick.So how are we going to write Node.js code? There’s nothing that would stop us from simply jumping onto our RasPi and using the Leafpad text editor or even the nano console-based editor to write our code.  I propose that we use some more robust tools in the form of an IDE (Integrated Development Environment) to help us along in our coding journey.It turns out that the RasPi 2 and RasPi 3—in spite of the significant CPU/memory boost they offer over their predecessors—will run most IDEs a bit sluggishly and will be frustrating for any serious Node.js work.  I offer here a creative alternative we will use to expedite the software development lifecycle and run the Node.js code natively on the Pi.In this tutorial, we’re going to use Visual Studio Code for doing Node.js development.  Don’t worry if you have another preferred IDE such as Sublime Text or Atom as these steps will be generally applicable.  I’m approaching this from the Windows platform, but I believe these steps can be adapted for OS X and Linux platforms as well.The solution is conceptually simple.  We will create a network file share on the RasPi and map the drive on the Windows machine so we can harness the computing power of our Windows machine to write the code.  When we are done writing the code, we can then run it natively on either the Windows machine or the RasPi.  We’ll see the beauty and versatility of cross-platform JavaScript in action!  Let’s get started.

Source: Using Visual Studio Code with a Raspberry Pi (Raspbian) | thisDaveJ