简体   繁体   English

找不到模块:错误:无法解析“D:\GitHub\project”中的“./C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js”

[英]Module not found: Error: Can't resolve './C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js' in 'D:\GitHub\project'

This happens when I try to run next build on my new windows laptop.当我尝试在我的新 windows 笔记本电脑上运行next build时,会发生这种情况。

C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js does exist, but it was trying a wrong routing by reading it in D:/github/project. C:/Users/user/AppData/Roaming/npm/node_modules/next/dist/client/next.js确实存在,但它通过在 D:/github/project 中读取它来尝试错误的路由。

Is there a way I can let next.js know it is getting into the wrong route?有没有办法让 next.js 知道它进入了错误的路线?

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

npx next build

For me, it worked when I deleted the./next dir and ran yarn install or npm i (Depending On Your Package Manager)对我来说,当我删除 ./next 目录并运行yarn installnpm i时它起作用了(取决于你的 Package 经理)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:找不到模块“C:\Users\senyo\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js” - Error: Cannot find module 'C:\Users\senyo\AppData\Roaming\npm\node_modules\expo-cli\bin\expo.js' 找不到模块:错误:无法解析“/home/user/Desktop/all/editor/node_modules/winston/dist/winston”中的“fs” - Module not found: Error: Can't resolve 'fs' in '/home/user/Desktop/all/editor/node_modules/winston/dist/winston' 错误:ENOENT:没有这样的文件或目录,打开'C:\\ Users \\ Dylan \\ AppData \\ Roaming \\ npm \\ node_modules \\ n_ \\ lodash-3。*。tgz' - Error: ENOENT: no such file or directory, open 'C:\Users\Dylan\AppData\Roaming\npm\node_modules\n_\lodash-3.*.tgz' 错误:找不到模块 'C:\Users\nguye\AppData\Local\nodejs\node_modules\npm\bin\npm-cli.js' - Error: Cannot find module 'C:\Users\nguye\AppData\Local\nodejs\node_modules\npm\bin\npm-cli.js' heroku ./node_modules/bootstrap/dist/js/bootstrap.js 找不到模块:无法解析“popper.js” - heroku ./node_modules/bootstrap/dist/js/bootstrap.js Module not found: Can't resolve 'popper.js' 未找到下一个条带错误模块:无法解析“./dist/client” - next-stripe error Module not found: Can't resolve './dist/client' 找不到模块:无法解析 Next.js 应用程序中的“fs” - Module not found: Can't resolve 'fs' in Next.js application (插件汇总核心)错误:无法加载/Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js - (plugin Rollup Core) Error: Could not load /Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js Next.js - 使用 BigQuery 客户端库时出现错误:找不到模块:无法解析“child_process” - Next.js - using BigQuery client library gives an error : Module not found: Can't resolve 'child_process' 在 Vercel 或 Netlify 上部署 next.js 项目失败并显示“找不到模块:无法解析...” - Deploying a next.js project on Vercel or Netlify fail with "Module not found: Can't resolve..."
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM