@Johnny Cheng , Firstly, apologies for the delayed response.
Based on my understanding of your issue description,
You may change your package.json
start command to use node_modules/next/dist/bin/next start
. This targets next
directly through node_modules
and will avoid this issue if attempting to start through NPM.
Just to highlight more on this, when using Oryx as the builder, symlinks are preserved during the build. Next.js (and other like-frameworks) use node_modules/.bin
which is symlinked to node_modules/next/dist/bin/next
. The .bin
folder is what helps make these commands like next start
available to NPM.
If you haven't done, you may add the setting the SCM_DO_BUILD_DURING_DEPLOYMENT
deployment setting to true
.
Kindly let us know how it goes, I'll follow-up with you further.
If the answer helped (pointed, you in the right direction) > please click Accept Answer - it will benefit community members to find the answers quickly.