Member-only story
How to fix “Unsupported engine” error when running NPM for NodeJS
So, here is a nasty error. I got the following error while running npm install
through NPM:
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: 'react-mongodb-app@1.0.0',
npm WARN EBADENGINE required: { node: '14.x', npm: '6.x' },
npm WARN EBADENGINE current: { node: 'v21.7.3', npm: '10.5.0' }
npm WARN EBADENGINE }
Or, it looks like the following.
Oh, well. I generated those NodeJS stuffs through GitHub Copilot, and it was “surprisingly” failing at that first time. I knew the answer has to be with that package defined in package.json
. But the question is how to fix it?
I decided to ask the question to “GitHub Copilot Chat” so whether I can fix the issue. So, here is the result.
So, the GitHub Copilot Chat was pointing out that I should fix my NPM/Node version. I took a close look at the package.json