I have spent quite a bit of time trying to figure out this and tried many combinations. Nothing worked and finally ended up doing this simple trick and it worked.
Issue : NPM path is not set when you install NodeJS and you keep getting the error
‘npm’ is not recognized as internal or external command, operable program or batch file
This is on Windows 10 Environment.
I tried many things like putting everything in Path of User Varible, Both places and in System Variable. Etc. All combinations failed. Finally, it was simple basic issue.
You cannot have Spaces in the Path. Windows does not recognize that.
I had something like this : %ANDROID_HOME%/platform-tools; C:\Program Files\nodejs;
I had fixed it to this : %ANDROID_HOME%/platform-tools;C:\Program Files\nodejs;
If you notice there is space above and I have removed that and it worked. Crazy on Windows, but it solved the issue.
Now, when I type npm on command prompt it works fine.