VOOZH about

URL: https://www.geeksforgeeks.org/node-js/how-to-install-axios-npm-in-terminal/

⇱ Axios npm - How to Install Axios npm in Terminal? - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Axios npm - How to Install Axios npm in Terminal?

Last Updated : 23 Jul, 2025

Axios is a popular JavaScript library for making HTTP requests in web applications. It simplifies the process of sending asynchronous requests and handling responses. It is commonly used with Node.js and in browser-based projects and can be installed via NPM (Node Package Manager).

In this article, we will explore the step-by-step process of installing and using Axios with practical examples.

Prerequisites

Steps to install and use Axios in the terminal with npm:

Step 1: Open the VSCode IDE and launch the terminal by using the "Ctrl + `" shortcut.

Step 2: Now, we will create the new folder by using the below command in the VScode terminal.

mkdir axios-use
cd axios-use

Step 3: After creating the folder, initialize the NPM using the below command. Using this the package.json file will be created.

npm init -y 

Step 4: Now, we will install the Axios package for our project using the below command.

npm install axios

👁 1

Step 5: To verify the installation, we can check the updated dependencies in package.json file:

"dependencies": { 
"axios": "^1.6.7",
}

Folder Structure:

👁 PS

Example: Write the following code in the app.js created as shown in folder structure.

To run the application, we need to start the server by using the below command.

node app.js

Output:

👁 Output

Comment
Article Tags:

Explore