the screen shot of project $ npm run build
> [email protected] build
> next build
(node:31220) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog\node_modules\postcss\package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
info - Creating an optimized production build
Failed to compile.
chunk 30cd56ec8b4292fd1d19f6bfd4b67b1689d06305_CSS
static/css/851b1bf4ba9315e79ff2.css
Cannot read property 'pop' of undefined
> Build error occurred
Error: > Build failed because of webpack errors
at C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog\node_modules\next\dist\build\index.js:15:918
at async C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog\node_modules\next\dist\build\tracer.js:1:525
npm ERR! code 1
npm ERR! path C:\Users\murtu\OneDrive\Desktop\myProject\nextjs_practice\new_practice\nextjs-blog
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c next build
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\murtu\AppData\Local\npm-cache\_logs\2020-12-24T13_03_26_358Z-debug.log
字符串
我正面临着这个问题,因为我已经尝试了许多解决方案,从互联网一样创建next.js.js该项目是完美的工作,而我正在使用这个一个npm run dev
可以有人帮助我在这里什么是这里的问题,因为我已经说过,该项目是完美的工作在npm run dev
。我真的厌倦了这个问题,请帮助我在这里。
2条答案
按热度按时间xtfmy6hx1#
即使你没有在你的帖子中提到它,我可以看到你正在使用NextJS。我今天只是偶然遇到了同样的问题,而没有真正对我们的应用程序进行任何更改。我发现对我们有效的修复方法是将以下内容添加到我们的next.js.js文件中。
字符串
希望这对其他人有用,并为他们节省一些时间。
cclgggtu2#
我在升级node和npm版本时遇到了这个错误。我只是删除了package-lock.json和node-modules文件夹,然后安装了npm。问题解决了。