Search code examples
node.jsnpmnpm-install

npm ERR! notsup Not compatible with your version of node/npm: [email protected] npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"}


I am building a next JS application when I tried to run that I am getting an error saying node version not supported. so I tried to update my node version I tried lot commands specified in various resource. I tried to delete the path provided in the environment variables but there is no path named node JS in my environment variables. And also I tried to delete npm cache node-gyp and folders in my system but also I am getting errors. What is the issue here? Here are the errors I get:

C:\Users\LENOVO>npm install -g n

npm notice npm notice New major version of npm available! 8.19.2 -> 10.2.5 npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.2.5 npm notice Run npm install -g [email protected] to update! npm notice npm ERR! code EBADPLATFORM npm ERR! notsup Unsupported platform for [email protected]: wanted {"os":"!win32"} (current: {"os":"win32","arch":"x64"}) npm ERR! notsup Valid OS: !win32 npm ERR! notsup Valid Arch: undefined npm ERR! notsup Actual OS: win32 npm ERR! notsup Actual Arch: x64

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache_logs\2023-12-16T13_52_45_735Z-debug-0.log

C:\Users\LENOVO> npm install -g [email protected]

npm ERR! code EBADENGINE npm ERR! engine Unsupported engine npm ERR! engine Not compatible with your version of node/npm: [email protected] npm ERR! notsup Not compatible with your version of node/npm: [email protected] npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"} npm ERR! notsup Actual: {"npm":"8.19.2","node":"v18.12.1"}

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache_logs\2023-12-16T13_53_18_837Z-debug-0.log

C:\Users\LENOVO>npm install npm@latest -g

npm ERR! code EBADENGINE npm ERR! engine Unsupported engine npm ERR! engine Not compatible with your version of node/npm: [email protected] npm ERR! notsup Not compatible with your version of node/npm: [email protected] npm ERR! notsup Required: {"node":"^18.17.0 || >=20.5.0"} npm ERR! notsup Actual: {"npm":"8.19.2","node":"v18.12.1"}

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache_logs\2023-12-16T13_54_18_107Z-debug-0.log


Solution

  • node -v [check your current version]

    nvm ls [displays all your installed version]

    nvm install 18.17.0 [install a specific version]

    nvm use 18.17.0 [switches to an installed version]