【问题标题】:Next.js with pkg. Syntax requires enabling one of the following parser plugin(s): 'flow, typescript'Next.js 与 pkg。语法需要启用以下解析器插件之一:'flow, typescript'
【发布时间】:2020-05-13 15:19:39
【问题描述】:

我基于此tutorial 在我的项目中使用带有pkg 的next.js,但是当我运行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"]
}

如何解决这个问题?

【问题讨论】:

    标签: javascript node.js dockerfile next.js zeit-pkg


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-10-11
      • 2021-06-01
      • 2018-09-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-13
      • 2020-05-23
      相关资源
      最近更新 更多