【发布时间】:2021-12-05 05:27:15
【问题描述】:
我正在尝试在 ubuntu LTS 18.0 上构建 next.js 应用程序 使用节点 14.18.0 也尝试使用节点 16 但没有运气!
yarn run v1.22.15
$ next build
info - Loaded env from /home/name/heb/HEB-IOT-UI/.env
info - Using webpack 5. Reason: Enabled by default https://nextjs.org/docs/messages/webpack5
info - Checking validity of types
warn - No ESLint configuration detected. Run next lint to begin setup
info - Creating an optimized production build
Failed to compile.
node:fs
Module build failed: UnhandledSchemeError: Reading from "node:fs" is not handled by plugins (Unhandled scheme).
Webpack supports "data:" and "file:" URIs by default.
You may need an additional plugin to handle "node:" URIs.
> Build error occurred
Error: > Build failed because of webpack errors
at /home/name/heb/HEB-IOT-UI/node_modules/next/dist/build/index.js:397:19
at async Span.traceAsyncFn (/home/name/heb/HEB-IOT-UI/node_modules/next/dist/telemetry/trace/trace.js:60:20)
at async Object.build [as default] (/home/name/heb/HEB-IOT-UI/node_modules/next/dist/build/index.js:77:25)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
【问题讨论】: