[英]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 install
或npm i
时它起作用了(取决于你的 Package 经理)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.