I removed the old version of grunt first, then I installed the new grunt version, and then I got this error:
D:\\www\\grunt-test\\grunt grunt-cli: The
I made the mistake to install some packages using sudo and other without privileges , this fixed my problem.
sudo chown -R $(whoami) $HOME/.npm
hope it helps someone.