本文介绍了带有pkg的Next.js。语法要求启用以下解析器插件之一:'flow,typescript'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基于此一起使用 https://medium.com/@evenchange4/deploy-a-commercial-next-js-application-with-pkg-and-docker-5c73d4af2ee rel = nofollow noreferrer>教程,但是当我运行时pkg命令出现错误:

I use next.js with pkg in my project based on this tutorial but when I run pkg command I get an error:

> 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命令:

pkg。 -t node13-linux-x64 -o build

Pkg版本:4.4.8

Pkg version: 4.4.8

我尝试添加选项,但仍然无法正常工作:

I tried to add options but still doesn't work:

"pkg": {
  "assets": [".next/**/*"],
  "scripts": [".next/dist/**/*.js"],
  "options": ["experimental-modules"]
}

如何解决此问题?

推荐答案

我删除了不必要的软件包,问题消失了! (反应脚本,故事书)。另外,不需要选项

I removed unnecessary packages and the problem is gone =| (react-scripts, storybook). Also options is not required

这篇关于带有pkg的Next.js。语法要求启用以下解析器插件之一:'flow,typescript'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 20:37