Recently, more and more sites are using the new ES Module syntax instead of CommonJS. Mixing the two different module management solutions can result in error messages such as:
Error: Must use import to load ES Module
To solve the problem, the following should be checked and modified:
- Your node.js version must be at least 14.
- You need to add
"type":"module"to the packages.json file