You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to deploy my Next JS application on Ubuntu with PM2, but keep getting the following error:
Error: Could not find a valid build in the '/var/www/vhosts/example.com/httpdocs/.next' directory! Try building your app with 'next build' before starting the server.
at Server.readBuildId (/var/www/vhosts/example.com/httpdocs/node_modules/next/dist/next-server/server/next-server.js:659:23)
at new Server (/var/www/vhosts/example.com/httpdocs/node_modules/next/dist/next-server/server/next-server.js:52:29)
at createServer (/var/www/vhosts/example.com/httpdocs/node_modules/next/dist/server/next.js:2:133)
at Object. (/var/www/vhosts/horibuful.com/httpdocs/server.js:9:13)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:32:23)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
I can confirm that the .next folder is being created after I run "yarn build" !!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there,
I am trying to deploy my Next JS application on Ubuntu with PM2, but keep getting the following error:
Error: Could not find a valid build in the '/var/www/vhosts/example.com/httpdocs/.next' directory! Try building your app with 'next build' before starting the server.
at Server.readBuildId (/var/www/vhosts/example.com/httpdocs/node_modules/next/dist/next-server/server/next-server.js:659:23)
at new Server (/var/www/vhosts/example.com/httpdocs/node_modules/next/dist/next-server/server/next-server.js:52:29)
at createServer (/var/www/vhosts/example.com/httpdocs/node_modules/next/dist/server/next.js:2:133)
at Object. (/var/www/vhosts/horibuful.com/httpdocs/server.js:9:13)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)
at Module.load (internal/modules/cjs/loader.js:1049:32)
at Function.Module._load (internal/modules/cjs/loader.js:937:14)
at Object. (/usr/lib/node_modules/pm2/lib/ProcessContainerFork.js:32:23)
at Module._compile (internal/modules/cjs/loader.js:1200:30)
I can confirm that the .next folder is being created after I run "yarn build" !!
Would appreciate some feedback on this!
Beta Was this translation helpful? Give feedback.
All reactions