Set up a Node.js development environment on Windows by using Visual Studio Code (VS Code).
-
Go to the VS Code official website and click Download for Windows to download the installation file.

-
Double-click the downloaded file, such as VSCodeUserSetup-x64-1.89.1.exe, and follow the installation wizard to install VS Code.
ImportantIn the Select Additional Tasks step, you must select Add to PATH (requires shell restart).
-
Open VS Code, click the Extensions icon in the left-side navigation bar or press
Ctrl+Shift+Xto search for the following extensions:-
Node.js Extension Pack: a collection of common tools for Node.js development.
-
JavaScript (ES6) code snippets: provides snippets for ES6.
-
Code Runner: runs code for programming languages such as Node.js, Python, C++, Java, PHP, and Go directly in the editor.
-
Alibaba Cloud API Toolkit (optional): streamlines development, debugging, and deployment between your local environment and Alibaba Cloud services. For more information, see Use Alibaba Cloud API Toolkit in VS Code.

-
-
Create a Node.js project.
In the VS Code menu bar, choose File > Open Folder, and then create and select a project folder. In this example, a folder named javascriptProjects is used.
-
Click the New File... icon to the right of the project name and enter a file name such as helloaliyun.js. Enter
console.log('hello aliyun!')in the right-side editor.
-
Run the code.
-
Select the file to run, such as helloaliyun.js. Click the Run and Debug icon in the left-side navigation bar or press
Ctrl+Shift+D. Click Run and Debug, and then select Node.js from the Select debugger drop-down list.
-
If you have installed the Code Runner extension, right-click anywhere in the editor and select Run Code.

-
On the TERMINAL tab, run the code by using the node command. In this example, run
node .\helloaliyun.js.
-
-
Verify that the development environment is set up.
On the DEBUG CONSOLE tab, check whether
hello aliyun!is returned. If the output appears, the Node.js development environment is ready.