We were running "npm install" in our Dockerfile and none of the above solutions worked. What worked for us was adding below lines to our Dockerfile
RUN rm -rf ~/.npm* && rm -rf /root/.npm*