Close Menu
The Roaming DevThe Roaming Dev

    Subscribe to Updates

    What's Hot

    Best Cities for Remote Developers (2026 Guide)

    June 3, 2026

    Remote Developer Setup: The Work-From-Anywhere Build

    June 3, 2026

    Remote Developer Jobs: The Complete Work-From-Anywhere Guide

    June 3, 2026
    Facebook X (Twitter) Instagram
    The Roaming DevThe Roaming Dev
    X (Twitter) Instagram Pinterest Reddit
    Subscribe Now
    • Home
    • About Us
    • Where to base
      1. Accomodation
      2. Best Places For Remote Devs
      3. Destination guides
      4. Coworking & wifi
      5. Travel Logistics
      Featured
      Best Places For Remote Devs

      Best Cities for Remote Developers (2026 Guide)

      June 3, 2026
      Recent

      Best Cities for Remote Developers (2026 Guide)

      June 3, 2026

      Best Places to Travel in Winter: Escape the Cold in 2025

      August 1, 2025

      Best Places to Visit in Europe in October for Fall Getaways

      July 4, 2025
    • Mobile Set-Up
      1. Connectivity and Security
      2. Dev tools & editor setup
      3. Laptops & portable hardware
      4. Productivity & collaboration
      5. View All

      What Is Digital Nomadism? The State of Digital Nomadism in 2024

      July 11, 2024

      How to Become a Digital Nomad in 2024 (Pros, Cons, and Common Jobs)

      February 28, 2024

      Best Python Frameworks for Web Development: A 2025 Guide

      September 22, 2025

      Best Open Source VPN: Secure Your Connection for Free

      September 1, 2025

      Best Open Source Software for Developers: Top Picks for 2025

      August 3, 2025

      Best Mechanical Keyboard for Programming: Top Picks for 2025

      May 8, 2025

      Best Speakers For Mac Mini: Enhance Your Audio Experience

      September 2, 2025

      Best Monitor for Mac Mini: Ultimate Buyer’s Guide

      August 5, 2025

      Best Monitor for Developers: Upgrade Your Coding Setup

      August 2, 2025

      Best Linux Distro for Developers: Find the Perfect Fit

      June 5, 2025

      7 Reasons Why is Laravel the best PHP framework in 2024?

      March 30, 2023

      How To Become a PHP Developer in 2024 [Step By Step Beginner’s Guide]

      January 25, 2023

      Is PHP Dead? The State Of PHP in 2024.

      January 24, 2023

      Remote Developer Setup: The Work-From-Anywhere Build

      June 3, 2026

      Best Python Frameworks for Web Development: A 2025 Guide

      September 22, 2025

      Best Video Players for Mac: Smooth & High-Quality Playback

      September 19, 2025

      Best Speakers For Mac Mini: Enhance Your Audio Experience

      September 2, 2025
    • Nomad Logistics
      • Banking & payments
      • Insurance & health
      • Taxes for remote workers
      • Visas & residency
    • Dev Careers
      1. Remote dev jobs & roles
      2. Freelancing & contracting
      3. View All

      Jobs for Americans in Europe: Ultimate Guide (2025)

      January 5, 2025

      17 Best Work-From-Home Jobs Requiring No Experience

      January 4, 2025

      LiveOps Reviews 2024: 11 Things To Know Before Signing Up

      November 3, 2024

      TranscribeMe Reviews 2024: 11 Things To Know Before Signing Up

      November 1, 2024

      Best AI for Coding: Free & Paid Options for Developers

      August 7, 2025

      Best Open Source LLM in 2025: The Ultimate Guide for Developers

      August 4, 2025

      Remote Developer Jobs: The Complete Work-From-Anywhere Guide

      June 3, 2026

      Best AI for Coding: Free & Paid Options for Developers

      August 7, 2025

      Best Open Source LLM in 2025: The Ultimate Guide for Developers

      August 4, 2025

      Jobs for Americans in Europe: Ultimate Guide (2025)

      January 5, 2025
    • Contact
    The Roaming DevThe Roaming Dev
    How To Run Javascript Code In Visual Studio Code Terminal. [Step By Step Guide 2024]
    Dev Careers

    How To Run Javascript Code In Visual Studio Code Terminal. [Step By Step Guide 2024]

    A Beginner Friendly Step-By-Step Guide on how to run Javascript Programs in Visual Studio Code
    The Roaming DevBy The Roaming DevJanuary 15, 2023Updated:May 14, 2024No Comments5 Mins Read
    Facebook Twitter Pinterest LinkedIn Tumblr WhatsApp Telegram Email
    node js logo
    Share
    Facebook Twitter LinkedIn Pinterest Email

    Table of Contents

    Toggle
    • I. Introduction
    • II. Step-By-Step Guide
      • Step 1: Ensure You Have Node JS Installed in your machine
        • How to Install Node Js On Your Laptop?
          • A. How to Install Node Js on Mac?
          • B. How to Install Node Js on Windows?
      • Step 2: Install Code Runner Extension
      • Step 3: Configure Code Runner Extension to run Javascript Code in Vs Code
      • Step 4: Run Your Javascript Code in Visual Studio Code
    • III. Bonus Tip For Windows Users:
        • How to resolve the “node is not recognized as an internal or external command ” error?
    • IV. Conclusion

    I. Introduction

    In this blog post, I’ll show you how to run Javascript Programs in Visual Studio Code terminal using the CodeRunner extension. We will use a Node Js code example, but this step-by-step applies to executing all other Javascript Frameworks’ code from the VS Code terminal.

    Currently, Javascript is the most popular programming language, with several known frameworks, including Node, Express, React, Vue, Svelte, and Inertia. Javascript is lightweight yet robust.

    Additionally, Javascript is easy to learn and therefore is very beginner friendly.

    Visual Studio Code (VS Code) is a popular choice for Javascript development due to its powerful features and wide range of extensions. One of these features of VS Code is its in-built terminal that allows developers to execute shell commands right within their IDE.

    It is pretty easy to run Javascript code inside VS Code by following these five steps:

    1. Ensure You Have Node JS Installed in your machine
    2. Install Code Runner Extension
    3. Configure Code Runner Extension
    4. Run Your Javascript Code in Visual Studio Code

    Let’s break down each of these steps.

    II. Step-By-Step Guide

    Step 1: Ensure You Have Node JS Installed in your machine

    Before using Javascript in VS Code, you’ll need to have Node Js and NPM installed on your computer. I recommend installing nothing less than Node 18.13.0(including npm 8.19.3). This is because the Long Term Support (LTS) version supports the latest versions of Javascript Frameworks and their features.

    To confirm node is installed on your machine, open terminal and run the following command.

    node -v

    You should get an output as below showing the node version installed.

    v19.0.1

    If you have the output above, proceed to Step 2.

    If you get an error in this step, you must install Node Js and NPM on your laptop. Installing Node on your computer will depend on the operating system in use.

    How to Install Node Js On Your Laptop?

    A. How to Install Node Js on Mac?

    For Mac users, I recommend using HomeBrew to install Node on your machine and for almost any other software you will ever need to install.

    Open your terminal and paste the below command:

    brew install node

    This will install the latest version of Node Js, which at the time of writing is node version 19.

    To install a specific version of Node Js, use the below command and substitute 18 with the respective version of Node Js you want.

    brew install node@18
    B. How to Install Node Js on Windows?

    To install Node Js on your windows laptop, download and Install it from the official website.

    Step 2: Install Code Runner Extension

    The next step is to install the CodeRunner extension for VS Code. This extension allows you to run Javascript code directly from within VS Code.

    You can install CodeRunner from the VS Code Extension Marketplace.

    Code Runner Extension

    Step 3: Configure Code Runner Extension to run Javascript Code in Vs Code

    Once the extension is installed, we are good to go with executing Javascript code from the VS Code terminal. No configurations are needed!

    Step 4: Run Your Javascript Code in Visual Studio Code

    With these steps done, you are ready to run your javascript code using the in-built VS Code terminal using Code Runner.

    CodeRunner can execute your Javascript code using either of these prompts:

    • Right-click from within the VS Code Text Editor and click Run Code.
    run JS code with code runner
    Right Click to Run Javascript Code with Code Runner
    • Press Ctrl + Alt + N on Windows and Shift + Option + N

    To test it out, you can copy this simple Node Js script.

    function hello(name) {
         console.log("hello " + name);
    }
    hello("CSS");

    Your output should be as below.

    Code Runner Js Output
    Code Runner Javascript code output

    III. Bonus Tip For Windows Users:

    How to resolve the “node is not recognized as an internal or external command ” error?

    Some Windows users will get the error message below when they try to execute Javascript code using Code Runner.

    'node' is not recognized as an internal or an external command, operable program or batch file.

    To fix this error, add the Node Executable File Path to Windows Environment Variables.

    1. Ensure Node Js is installed on your laptop
    2. On Your Windows Search, open Control Panel
    3. Click the Advanced System Settings
    4. Click on Environment Variables
    5. In the New System Variable window, add Node Executable File Path to the value of the PATH environment variable
    6. Close and re-open all terminal windows
    Add Node environment Variable
    Add Node Js to Environment Variables In Windows

    IV. Conclusion

    In this blog post, I have shown you how to run your Javascript code in VS Code terminal using the CodeRunner extension. We’ve covered how to install Node and configure VS Code, and how to install and use the CodeRunner extension.

    We have also included a bonus tip to fix a common how to resolve the “node is not recognized as an internal or external command ” error.

    By following these steps, you’ll be able to take advantage of the powerful features of VS Code and CodeRunner to develop and debug your Javascript code.

    Related: How To Run PHP Code in VS Code Terminal

    Picks
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email
    The Roaming Dev
    • Website

    Related Posts

    Remote Developer Jobs: The Complete Work-From-Anywhere Guide

    June 3, 2026

    Best AI for Coding: Free & Paid Options for Developers

    August 7, 2025

    Best Open Source LLM in 2025: The Ultimate Guide for Developers

    August 4, 2025

    Jobs for Americans in Europe: Ultimate Guide (2025)

    January 5, 2025

    17 Best Work-From-Home Jobs Requiring No Experience

    January 4, 2025

    LiveOps Reviews 2024: 11 Things To Know Before Signing Up

    November 3, 2024
    Add A Comment

    Comments are closed.

    Subscribe to My Newsletter

    Don't Miss
    Best Places For Remote Devs

    Best Cities for Remote Developers (2026 Guide)

    June 3, 2026

    Forget the beach photos for a second. The best city for a remote developer is…

    Remote Developer Setup: The Work-From-Anywhere Build

    June 3, 2026

    Remote Developer Jobs: The Complete Work-From-Anywhere Guide

    June 3, 2026

    Best Python Frameworks for Web Development: A 2025 Guide

    September 22, 2025
    Our Picks

    Top 10 Best Mac Time Tracking Apps For 2024 [Including Free Options]

    January 30, 2023

    10 Best Remote Collaboration Software For 2024[Pros, Cons & Pricing]

    January 29, 2023

    10 Best Mac Apps For Developers In 2024

    January 28, 2023

    How To Become a PHP Developer in 2024 [Step By Step Beginner’s Guide]

    January 25, 2023
    Stay In Touch
    • Twitter
    • Pinterest
    • Instagram
    • Reddit
    About The Roaming Dev
    About The Roaming Dev

    Discover the digital nomad lifestyle, remote work insights, travel adventures, developer guides, and top software recommendations on our lifestyle blog. Your hub for a tech-savvy, nomadic journey.

    Email us: theroamingdev@gmail.com

    Follow me on social media for more content!

    X (Twitter) Instagram Pinterest Reddit
    Our Picks

    Top 10 Best Mac Time Tracking Apps For 2024 [Including Free Options]

    January 30, 2023

    10 Best Remote Collaboration Software For 2024[Pros, Cons & Pricing]

    January 29, 2023

    10 Best Mac Apps For Developers In 2024

    January 28, 2023
    Legal & Compliance
    • Terms Of Use
    • Disclaimer
    • Privacy Policy
    Facebook X (Twitter) Instagram Pinterest
    • Home
    • Dev Careers
    • Where to base
    • Mobile Set-Up
    • Nomad Logistics
    © 2026 The Roaming Dev

    Type above and press Enter to search. Press Esc to cancel.

    ~/the-nomads-choice/subscribe.sh
    Wifi · Found

    # for devs who push to prod from a hammock

    $ join –roaming-devs

    One email. Zero fluff. The tools, gigs, visas, and dirt-cheap fast-wifi spots that keep roaming devs shipping from anywhere on Earth.

    ✓remote gigs & contracts worth your time
    ✓nomad-proof tools, setups & dev stacks
    ✓visa & tax hacks, decoded for builders
    ✓fast-wifi cafés the tourists never find
    broadcasting live from a beach in Bali

    no spam, ever. unsubscribe in 1 click. — The Nomad’s Choice

    Ad Blocker Enabled!
    Ad Blocker Enabled!
    Our website is made possible by displaying online advertisements to our visitors. Please support us by disabling your Ad Blocker.