I have made a few updates to my dependencies and attempted a new deploy. I have added a NODE_VERSION environmental variable in order to ensure I am using Node.js 19.3.0. However, now I am getting a series of error messages that I cannot understand:
I have set an NPM_FLAGS environmental variable in order to pass --legacy-peer-deps to the npm install command, but I don’t see any evidence that this has been received. Is there any way to tell?
Yes. Unfortunately, when moving back to version 3 of the plugin, I see a message that I have to upgrade my Next.js version to atleast 10.0.6. And when I do that, I get the same error message we saw at the beginning of this thread:
Keep in mind this is not my code, it’s in the node_modules dependencies.
As far as I can see, you’re now using Node 14: Netlify App (while previously you were using Node 12). Since this is still happening with Node 14, I think you should reach out to the library’s authors to get it fixed (assuming it’s a problem with the dependency). Next 10 is an outdated version and we no longer provide active support for it, so if it’s some Next.js’ problem (or even of Next.js on Netlify specifically), we do not have any useful advice.
I appreciate your responses. I have fixed this problem by doing what I really didn’t want to do, updating to Next.js 13. I also changed a problematic dependency, material-ui-grid, to the proper replacement, @mui/x-data-grid. I was able to take the starter project for Next.js 13, and add my project in, page by page. Now everything compiles correctly, I’m using Node.js 19.3.0, and the latest version of the Netlify Next.js plugin. Thanks again for your help.