node.js – Issue with installing Nodejs +npm in Windows10

I have tried installing latest version of NodeJS(v20.16.0) on my Windows10 laptop both by command line and and installer. For some reason the npm version getting installed isn’t the latest expected i.e. 10.8.1. The version of npm getting installed is always 6.4.1. I am not understanding why this is happening. I have tried using different versions of node (older) still the same issue.

Tried installing different versions, clearing cache, restarting laptop. The environment variable was configured correctly and everything.
Error

enter image description here

Read more here: Source link