First, run a new isolated container:
docker run --rm -it ubuntu bash
Now, setup npm and try to install package:
apt-get update && apt-get install -y npm
npm install grunt
You might see some funky garbage in your terminal window. Sometimes, it will hang, so expect to kill your session out of band.