+3 votes
64 views
Install Node JS in Visual Studio Code

in javascript by (551k points)
reopened | 64 views

1 Answer

+4 votes
Best answer

1 How to install Node.js in Visual Studio Code

Visual Studio Code is a code editor available for various platforms (such as Windows, macOS and Linux) in which we find numerous tools for developers such as IntelliSense code completion and debugging, integrated support for JavaScript, TypeScript and Node.js as well as extensions to more popular languages ​​and runtimes like C++, C#, Java, Python, and more..

 

Visual Studio Code Features
Some of the features of Visual Studio Code are:
  • integrates build tools and scripts
  • Allows you to open an HTML file in the web browser
  • We can start or stop the server with a single click from the status bar
  • Compatibility with current browsers
  • Customizable port number, server root and other components
  • Support to exclude files for change detection
  • SVG support
  • https support
  • Integrated source code editor
  • It makes use of a tool service architecture with which it will be possible to integrate with utilities from other technologies.
  • Enables easy debugging, profiling and diagnostics
  • It has comprehensive testing tools
  • Support for multiple programming languages
  • website support
  • terminal support
  • Git support
  • Hierarchical structure for archive codes

 

 

Now, one of the most important utilities with which we can use and extend Visual Studio Code is with Node.js, Node.js is a platform that allows us to create functional and scalable server applications through JavaScript. Node.js works as the runtime and npm is the package manager that manages Node.js modules.

 

Visual Studio Code is fully compatible with JavaScript and TypeScript languages ​​and incidentally with Node.js debugging, the only requirement is that in order to run a Node.js application it will be necessary to install the Node.js runtime locally on our equipment. TechnoWikis will teach you how to carry out this process and have the maximum potential of node.js and Visual Studio Code..

 

 

To stay up to date, remember to subscribe to our YouTube channel!
SUBSCRIBE ON YOUTUBE

 

 

1 How to install Node.js in Visual Studio Code

 

Step 1

We go to the Node.js URL in the following link:

 

 node.js

 

image

 

Step 2

Download the recommended version:

 

image

 

Step 3

We execute the file to see the following window:

 

image

 

Step 4

We click on "Run" to launch the installation wizard:

 

image

 

step 5

We click Next and we must accept the license terms:

 

image

 

step 6

After this we will see the path where Node.js will be installed:

 

image

 

step 7

Below it is possible to section the features that will be installed with Node.js:

 

image

 

step 8

In the next window it is possible to enable the box to automatically install the extra tools that we will see later:

 

image

 

step 9

We will see the following later:

 

image

 

step 10

We click on "Install" to start the installation process of Node.js:

 

image

 

step 11

At the end of this process we will see the following:

 

image

 

step 12

In case of activating the box to install the extra tools after a moment the terminal will open:

 

image

 

step 13

Press any key and PowerShell will open:

 

image

 

step 14

There the installation process of the utilities will begin:

 

image

 

step 15

This takes time to download and install each of them:

 

image

 

step 16

Once this is finished we open Visual Studio Code and drag the working folder there:

 

image

 

step 17

We will see the following message:

 

image

 

step 18

We click on "Yes, I trust the authors" to add the folder in Visual Studio Code:

 

image

 

step 19

It is time to add the Node.js variable in the system, for this we enter "variable" in the search engine and click on "Edit system environment variables":

 

image

 

step 20

The following window will open:

 

image

 

step 21

We click on "Environment variables" to access the variables window:

 

image

 

step 22

We open the File Explorer and copy the path of Node.js:

 

image

 

Step 23

In the variables we click on "New" in "User variables" and then we enter a name and paste the Node.js path:

 

image

 

step 24

Apply the changes:

 

image

 

step 25

In Visual Studio Code we go to "Terminal - New Terminal":

 

image

 

Step 26

We execute the following:
 npm init 
image

 

step 27

You may see the following error:

 

image

 

Step 28

If we see this error, using the "cd .." command we go to the root of the C drive and then with "cd" we go to the Node.js path:

 

image

 

Step 29

There we start Node JS by executing the following:
 /nmp init 
Press the Enter key to complete the process:

 

 

image

 

step 30

Note: the Enter key must be pressed since when starting NPM we see this:

 

image

 

step 31

They are a series of questions that we can leave by default:

 

image

 

step 32

At the end we will see the following:

 

image

 

Step 33

It is possible to install a utility with the syntax:
 ./nmp install (app) 
image

 

Some extra commands to use npm are:

  • npm install: install all dependencies in the project
  • npm test: run the tests of the project
  • npm run <script>: run the script in question
  • npm -l : display command usage information
Thus it is possible to install Node.js in Visual Studio Code and have a tool at hand for our projects.

 


by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Aug 16, 2023 in Linux/Unix by backtothefuture (551k points) | 52 views
+5 votes
1 answer
asked Jun 4, 2020 in Other languages by backtothefuture (551k points) | 560 views
+4 votes
1 answer
asked Dec 22, 2022 in Git by backtothefuture (551k points) | 62 views
+5 votes
1 answer
+5 votes
1 answer
asked Apr 8, 2021 in Virtualization by backtothefuture (551k points) | 258 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,634 questions
10,766 answers
510 comments
3 users