Have done a lot of googling, tried reinstalling node.js using the official installer, but my npm pathing still doesn't work.
This doesn't work
npm install foo
I get an error message saying missing module npm-cli.js
2 hours of googling later I discovered a workaround
Instead of simply 'npm' I type
node C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
But how can I correct my nodejs install so I can simply type 'npm' ?
You need to Add C:\Program Files\nodejs
to your PATH environment variable. To do this follow these steps:
C:\Program Files\nodejs
. Make sure it is separated from any other paths by a ;
.You will have to restart any currently-opened command prompts before it will take effect.