NodeJS is a powerful and popular JavaScript runtime environment, widely used for developing dynamic web applications. In this step, you will install NodeJS on your operating system to build your dynamic e-commerce website.
Download NodeJS from the official website:
Install NodeJS on Windows:
Install NodeJS on macOS:
Install NodeJS on Linux (Ubuntu):
Use the following command to install NodeJS:
sudo apt install nodejs
Verify the installation:
After installation, open your terminal (or Command Prompt on Windows) and run the following command to check the NodeJS version:
node -v
If the installation is successful, you will see the NodeJS version displayed.
Example
After installation, open your terminal (or Command Prompt on Windows) and enter the following command to check the NodeJS version:
C:\Users\thuan>node -v
v20.17.0
NodeJS has been installed successfully! You can now start building JavaScript applications for both the frontend and backend of your website.
npm (Node Package Manager) is a tool used to manage libraries and packages in NodeJS projects.
Open the Frontend directory in your project.
Run the following command:
npm i
Check npm:
npm is automatically installed when you install NodeJS.
Check the npm version with the command:
npm -v
Update npm (if needed):
Update npm (if needed)
npm install -g npm