📌  相关文章
📜  从(“节点获取”)导入获取; ^^^^^^ SyntaxError: Cannot use import statement outside a module - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:04:24.908000             🧑  作者: Mango

代码示例1
/*
In the nearest parent package.json file, add the top-level "type"
field with a value of "module". This will ensure that all .js and .mjs
files are interpreted as ES modules. You can interpret individual files
as CommonJS by using the .cjs extension.
*/
// package.json
{
  "type": "module"
}