Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

前端运行部署 npm run start 遇到问题 #20

Open
oscarklv opened this issue Apr 22, 2023 · 1 comment
Open

前端运行部署 npm run start 遇到问题 #20

oscarklv opened this issue Apr 22, 2023 · 1 comment

Comments

@oscarklv
Copy link

以下错误似乎是chatgpt-plus-main资料夹没有 .next档,需要'next build'......

PS C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\dist> npm run start

[email protected] start
next start

ready - started server on 0.0.0.0:3000, url: http://localhost:3000
info - Loaded env from C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main.env

Error: Could not find a production build in the 'C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main.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 (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next-server.js:254:23)
at new Server (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\base-server.js at new NextNodeServer (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next-server.js:73:9)
at NextServer.createServer (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next.js:152:24)
at async C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next.js:165:31
at async NextServer.prepare (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next.js:134:24)
at async Object.startServer (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\ at async nextStart (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\cli\next-start.js:68:5)

@zhpd
Copy link
Owner

zhpd commented Apr 25, 2023

以下错误似乎是chatgpt-plus-main资料夹没有 .next档,需要'next build'......

PS C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\dist> npm run start

[email protected] start
next start

ready - started server on 0.0.0.0:3000, url: http://localhost:3000 info - Loaded env from C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main.env

Error: Could not find a production build in the 'C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main.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 (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next-server.js:254:23) at new Server (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\base-server.js at new NextNodeServer (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next-server.js:73:9) at NextServer.createServer (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next.js:152:24) at async C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next.js:165:31 at async NextServer.prepare (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\next.js:134:24) at async Object.startServer (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\server\ at async nextStart (C:\Users\Oscar\Desktop\VScode\chatgpt-plus-main\node_modules\next\dist\cli\next-start.js:68:5)

这是打包运行吗,打包运营需要先执行npm run build,然后再执行npm run start , 因为nextjs启动需要一些指令,所以必须在项目根目录下执行命令

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants