我yarn install
,yarn build
,构建Docker镜像,部署到EKS,遇到以下运行时错误:
NODE_ENV: production
(node:1) [DEP0111] DeprecationWarning: Access to process.binding('http_parser') is deprecated.
at process.binding (node:internal/bootstrap/loaders:140:17)
at Object.<anonymous> (/node_modules/http-deceiver/lib/deceiver.js:22:24)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.<anonymous> (/node_modules/spdy/lib/spdy/handle.js:5:20)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
DeprecationWarning: Access to process.binding('http_parser') is deprecated.
at process.binding (node:internal/bootstrap/loaders:140:17)
at Object.<anonymous> (/node_modules/http-deceiver/lib/deceiver.js:22:24)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at Module._load (node:internal/modules/cjs/loader:972:12)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.<anonymous> (/node_modules/spdy/lib/spdy/handle.js:5:20)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
warn - You have enabled experimental features (forceSwcTransforms, swcTraceProfiling, externalDir, appDir) in next.config.js.
warn - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use at your own risk.
info - Thank you for testing `appDir` please leave your feedback at https://nextjs.link/app-feedback
/node_modules/next/dist/server/next-server.js:198
throw new Error(`Could not find a production build in the '${this.distDir}' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id`);
^
Error: Could not find a production build in the '/.next' directory. Try building your app with 'next build' before starting the production server. https://nextjs.org/docs/messages/production-start-no-build-id
at NextNodeServer.getBuildId (/node_modules/next/dist/server/next-server.js:198:23)
at new Server (/node_modules/next/dist/server/base-server.js:68:29)
at new NextNodeServer (/node_modules/next/dist/server/next-server.js:70:9)
at NextServer.createServer (/node_modules/next/dist/server/next.js:147:16)
at async /node_modules/next/dist/server/next.js:159:31
at async NextServer.prepare (/node_modules/next/dist/server/next.js:134:24)
Node.js v19.9.0
我错过了什么?
1条答案
按热度按时间guicsvcw1#
将
ADD .next .next
添加到Dockerfile