【问题标题】:Module not found: Error: Can't resolve './C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js' in 'D:\GitHub\project'找不到模块:错误:无法在 \'D:\\GitHub\ 中解析 \'./C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js\' \项目\'
【发布时间】:2023-01-05 18:46:38
【问题描述】:

当我尝试在我的新 Windows 笔记本电脑上运行 next build 时会发生这种情况。

C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js 确实存在,但它通过在 D:/github/project 中读取它来尝试错误的路由。

有没有办法让 next.js 知道它进入了错误的路线?

【问题讨论】:

    标签: node.js next.js


    【解决方案1】:

    运行此命令解决了我的问题:

    npx next build

    【讨论】:

      【解决方案2】:

      对我来说,当我删除 ./next 目录并运行 yarn installnpm i 时它起作用了(取决于你的包管理器)

      【讨论】:

        猜你喜欢
        • 2020-03-15
        • 1970-01-01
        • 1970-01-01
        • 2021-02-20
        • 2014-09-26
        • 2014-12-23
        • 2014-12-04
        • 2022-07-17
        • 2021-05-21
        相关资源
        最近更新 更多