๐Ÿ“œ To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

package.json

{
  "name": "node",
  "type": "module", // ๅขžๅŠ ๆญค่กŒ
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT"
}
1
2
3
4
5
6
7