SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Function.Module.runMain (internal/modules/cjs/loader.js:1047:10)
at internal/main/run_main_module.js:17:11
我尝试了几种方法来解决此问题。 节点版本:12.14.0
{
"type": "module",
"name": "fcmanager-frontend",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "env-cmd -e prod react-scripts start",
"build": "env-cmd -e prod react-scripts start",
}
}
每当我尝试从src文件夹中尝试“ node App.js”时,它均不起作用。有人可以帮我吗?