
To set a breakpoint in app.js, put the editor cursor on the first line and press kb() or click in the editor left gutter next to the line numbers. Let's try debugging our simple Hello World application. Debugging Hello WorldĪs mentioned in the introduction, VS Code ships with a debugger for Node.js applications. View > Terminal ( kb() with the backtick character) will open the integrated terminal and you can run node app.js there:įor this walkthrough, you can use either an external terminal or the VS Code integrated terminal for running the command-line tools. You can run Node.js directly from there and avoid switching out of VS Code while running command-line tools.

VS Code has an integrated terminal which you can use to run shell commands. You should see "Hello World" output to the terminal and then Node.js returns. Let's get started by creating the simplest Node.js application, "Hello World".Ĭreate an empty folder called "hello", navigate into and open VS Code: To learn more, go to Developing in WSL or try the Working in WSL tutorial. When coupled with the WSL extension, you get full VS Code editing and debugging support while running in the context of WSL. You can run Linux distributions on Windows and install Node.js into the Linux environment. Windows Subsystem for Linux: If you are on Windows, WSL is a great way to do Node.js development.

See Installing Node.js via package manager to find the Node.js package and installation instructions tailored to your version of Linux. Linux: There are specific Node.js packages available for the various flavors of Linux. To test that you have Node.js installed correctly on your computer, open a new terminal and type node -version and you should see the current Node.js version installed. You'll need to open a new terminal (command prompt) for the node and npm command-line tools to be on your PATH. The Node Package Manager is included in the Node.js distribution.

To get started in this walkthrough, install Node.js for your platform. However, to run a Node.js application, you will need to install the Node.js runtime on your machine. Visual Studio Code has support for the JavaScript and TypeScript languages out-of-the-box as well as Node.js debugging. Node.js is the runtime and npm is the Package Manager for Node.js modules. Node.js is a platform for building fast and scalable server applications using JavaScript.
