Can't resolve 'axios' in 'C:\Users\716968\vue003\src\components'
时间: 2023-09-12 08:08:54 浏览: 164
Vue+Typescript中在Vue上挂载axios使用时报错问题
The error message "Can't resolve 'axios' in 'C:\Users\716968\vue003\src\components'" indicates that your project is unable to find the 'axios' dependency.
To resolve this issue, you can follow these steps:
1. Install 'axios' as a dependency in your project by running the following command in your project directory:
```
npm install axios
```
2. Make sure the installation completes successfully without any errors.
3. Import 'axios' in your component file where you want to use it. You can add the following line at the top of your component file:
```javascript
import axios from 'axios';
```
4. Save the changes and restart your application. The error should be resolved, and you should be able to use 'axios' in your component.
If you have already installed 'axios' but still facing this issue, make sure that the path to the component file is correct, and the 'axios' package is listed as a dependency in your project's `package.json` file.
阅读全文