报错:[plugin:vite:import-analysis] Failed to resolve import “axios“ from “src\components\Main.vue“. Do

 

 

This error usually means that the axios library is missing from your code or that it has not been imported correctly. You can follow these steps to resolve the issue:

  1. Confirm that you have installed the axios library. You can install axios using the following command in the terminal:

    npm install axios
    
  2. Confirm that you have imported the axios library correctly. In your component you need to bring in the axios library using:

    import axios from 'axios';
    
  3. Confirm that your path is correct. A path "src\components\Main.vue" is mentioned in the error message. Please make sure this path is correct, the file exists, and you have correctly introduced the axios library.

If you still can't solve the problem after following the above steps, you can try to reinstall the axios library or check other possible errors.

 

Guess you like

Origin blog.csdn.net/DXB2021/article/details/132332671