Step 1: Download & Install Node.js
1) Firstly we’ll have to download the latest version of Nodejs available on the internet. Follow the below-provided download link and you’ll be redirected to the official Nodejs downloads page. Now simply click on the “Mac Installer” button and your download will start.
Download Nodejs Here: https://nodejs.org/en/download/
2) After the downloads get finished open it in the folder where it has been downloaded and simply double click on the downloaded file to start the Nodejs installation wizard.
3) In the Introduction window of Nodejs installation wizard click next to continue the installation process.
4) Next you’ll have to accept the license agreement for Nodejs installation, simply click on the agree to button.
5) In this final step make sure you have 102Mb of free disk space available, click on the install button, if asked enter your Mac password and your installation of Nodejs will start.
6) Once installation gets finished click on the close button.
Step 2: Check Nodejs & Npm Version
1) Open Up your terminal by pressing “cmd+space”, type “terminal” in the search bar and press enter.
2) In the terminal type
and press return to check the installed version of Nodejs.
3) Again in the terminal type
and press return to check the installed version of Node Package Manager.
Congrats 🎉🎉 you’ve successfully installed Nodejs on your Mac machine.
2) Now again search for “code runner” and select the first option provided by Jun Han and install it in the same way described above.
with this extension, you can run the code by pressing Ctrl+Option+N and stop the same by pressing Ctrl+Option+M
3) Create a New File in vs code by simply clicking “Cmd+N“.
4) Save this newly created file by the name “subscribe.js“.
Also Read: How To Run Python in Visual Studio Code on Mac OS