The problem is that Node.js does not currently support import and export natively yet. It is still experimental according to 文件. I recommend you use 巴别塔 to compile your code and allow you to use import and export.
ERROR in ./src/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
Error [ERR_REQUIRE_ESM]: Must use import to load ES Module: /home/pradeep/Work/my_project/node_modules/@babel/runtime/helpers/interopRequireWildcard/_index.mjs
然后我意识到我在 与本项目中用于安装软件包的 Node.js 版本不同 上。
I had two options:
Change Node.js version to the one required by this project and build again.