NextJs - 运行“npm run build”时出错:./node_modules/next/dist/server/lib/router-utils/filesystem.d.ts:65:72 类型错误:'>'预期

问题描述 投票:0回答:1

我的 Nextjs 项目遇到了错误,我不知道如何修复它,因为这不是我的错。

主要问题

这个错误:当我使用“npm run build”时返回

./node_modules/next/dist/server/lib/router-utils/filesystem.d.ts:65:72 Type error: '>' expected
,它的主体是:


  63 |     dynamicRoutes: FilesystemDynamicRoute[];
  64 |     nextDataRoutes: Set<string>;
> 65 |     exportPathMapRoutes: undefined | ReturnType<typeof buildCustomRoute<Rewrite>>[];
     |                                                                        ^
  66 |     devVirtualFsItems: Set<string>;
  67 |     prerenderManifest: PrerenderManifest;

我尝试运行“npm升级”,更新Nodejs(实际上是在23.3.0,也尝试使用LTS版本)两天以来,看看next模块是否发生任何变化,什么也没发生,我不知道不知道如何解决这个问题。

reactjs next.js build typeerror
1个回答
0
投票

降级到 14.2.20 对我有用

// package.json
...
"next": "14.2.20",
...

注意,15 个颠覆似乎都无法在 15.0.4 中发挥作用。

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.