我的 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模块是否发生任何变化,什么也没发生,我不知道不知道如何解决这个问题。
降级到 14.2.20 对我有用
// package.json
...
"next": "14.2.20",
...
注意,15 个颠覆似乎都无法在 15.0.4 中发挥作用。