I have issue , my eb is in intranet environment so it can't do npm installl by itself.
similar issue happened for my angular app so i added the node modules together with zip file ,
I have created the two package.json , one for node json only kept in parent folder ,
then i have done npm install locally for parent folder, less node modules installed.
then zipped together dist build file , server.js and nodemodule for angular it was working,But similar thing in nextjs i am not sure