3

我根据本教程在我的项目中将 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"]
}

如何解决这个问题?

4

1 回答 1

0

我删除了不必要的软件包,问题就消失了=| (反应脚本,故事书)。也不options需要

于 2020-05-13T20:32:00.187 回答