After successfully installing Node.js, you can use the Node Package Manager (NPM) tool to create a new Node.js project to start working on it. How is it in details? In this tutorial, I will guide you all to do this.
First, open Terminal (macOS or Linux) or Console (Window), go to a directory where you want to create the project, then enter the following command:
Myself as follows:
Next, as you can see, is the version information. I’ll leave it to default and hit Enter to continue:
Add some description of your project. You can add your own and then press Enter to continue, as follows:
The entry point is the file that contains the main script for our project. You can leave the defaults, we can edit them later, and then press Enter.
If you already know the command to run the test in Node.js then you can declare it here. I have no need so will leave this information empty then press Enter.
If you have a need to use Git to manage source code, then you can enter information about Git Repository here. I will leave this information empty, then press Enter.
keywords are some information that you can fill in so that users can search your project. I have no need, so will leave this information empty, then press Enter to continue.
Author is the author’s information. Please enter your name: D, then press continue.
License relates to the copyright of the project. You can enter the license information according to your needs or use common licenses such as BSD-3-Clause, MIT, ISC, … Here, I will default and then Enter.
This is the window to confirm the information that you just entered. If OK then press Enter to finish creating the new Node.js project using Node Package Manager.
Check the current directory, you will see a file named package.json containing the information about the Node.js project that we just entered. My result is as follows:
"description": "Node.js Example",
"test": "echo \"Error: no test specified\" && exit 1"
"author": "Khanh Nguyen",