我根据本教程在我的项目中将 next.js 与pkg一起使用,但是当我运行 pkg 命令时出现错误:
> Error! This experimental syntax requires enabling
one of the following parser plugin(s): 'flow, typescript' (13:7)
/app/node_modules/ast-types-flow/lib/types.js
包命令:
pkg . -t node13-linux-x64 -o build
包版本:4.4.8
我尝试添加选项但仍然无法正常工作:
"pkg": {
"assets": [".next/**/*"],
"scripts": [".next/dist/**/*.js"],
"options": ["experimental-modules"]
}
如何解决这个问题?