代码之家  ›  专栏  ›  技术社区  ›  RIDDHIDIPTA PAL

我在尝试部署nextjs应用程序时遇到此错误

  •  0
  • RIDDHIDIPTA PAL  · 技术社区  · 1 年前

    这是我正在构建的nextjs应用程序的next.config.js文件。该网站只有一个包含多个组件的页面。文件如下: https://github.com/CodingLife1024/substainify

    Run npx --no-install next export
      npx --no-install next export
      shell: /usr/bin/bash -e {0}
      env:
        GITHUB_PAGES: true
     ⨯ 
        The "next export" command has been removed in favor of "output: export" in next.config.js. Learn more: https://nextjs.org/docs/advanced-features/static-html-export
      
    Error: Process completed with exit code 1.
    

    即将出现的错误是

    运行npx--不安装下一个导出
    npx—不安装下一个导出
    shell:/usr/bin/bash-e{0}
    环境:
    GITHUB_PAGES:真
    ¨
    “next export”命令已被删除,取而代之的是next.config.js中的“output:export”。了解更多信息:https://nextjs.org/docs/advanced-features/static-html-export
    
    错误:进程已完成,退出代码为1。
    

    我尝试手动运行此

    Run npx --no-install next export
    

    这会产生错误:

     ⨯ 
        The "next export" command has been removed in favor of "output: export" in next.config.js. Learn more: https://nextjs.org/docs/advanced-features/static-html-export
    

    我也尝试过卸载和重新安装npm和npx。

    0 回复  |  直到 1 年前
        1
  •  0
  •   Στρατος ΠαπαφωτιοϠ   1 年前

    添加 output: 'export' 在您的 next.config.js

    next build 将创建静态html页面,不需要运行 next export 因为它已经不存在了