I am currently working on a nodejs web application I am having trouble pushing the application online with cloud foundry. I did some research on the errors and it seems that
Delete the ~/.node-gyp folder and then the ~/.npmrc file.
Reboot your server and rerun npm install in your project folder
Edit:
Warning: removing ~/.npmrc will delete your other configurations