Must use import to load ES Module: D:\yy语音\学习\new\guli\vue\vue-front-1010\node_modules\axios\index.js require() of ES modules is not supported.
时间: 2023-08-10 10:02:33 浏览: 124
It seems like you are encountering an issue with importing an ES module in your project. The error message "Must use import to load ES Module" indicates that you are trying to use the `require()` function to load an ES module, which is not supported.
To resolve this issue, you should use the `import` statement instead of `require()` to import ES modules. Here's an example of how to import the `axios` module using the `import` statement:
```javascript
import axios from 'axios';
```
Make sure that your project is configured to support ES modules, as some older versions of Node.js may not have native support for it. You can also check if the `axios` module you are using is compatible with the version of Node.js you are using.
If you are still facing issues, please provide more details about your project setup and any relevant code snippets, so I can assist you further.
阅读全文