Hello,
Here is the simple solution when u get error while running nextjs on localhost or through CLI.
You will be pointing to the old node version or new which is not compatible with the current version of Nextjs you might be using.
So switching the node version to the supporting NextJS will fix the run time issue on localhost.
Thanks for learning.
Happy Learning