How to always rebuild without NPM cache

Packages and NodeJS versions move rapidly in the Javascipt world. We frequently fail builds and then pass them when rebuilding without the cache when we update packages or versions of Node.

Is there any way to always build without the cache?

I’m guessing you could specify empty cache_directories in the circle.yml file and that might work but I thought it would be better to ask the pros.


Unfortunately there is no great way to do this right now other than just clearing out the node_modules directory at the start of the build.

We have had many reports of general caching issues with node and are working on a better solution.

Hi is there any update on this? Having to do a full npm install on every build is not good. That adds a good 3+ minutes for us. That’s a lot of overhead for something that 9 times out of 10 its not necessary.

Still no word on fixing the npm caching issues?

@levlaz do you have any update about a possible fix?

Hey guys, any updates on this? It would be great to be able to prevent npm cache with a simple setting on circle.yml. Looking forward for an answer.


This is also causing intermittent failures for my team.

We updated our version of node to 6.9.5, which broke bindings for node-sass. Despite the fact that we have updated circle.yml to include the following, we still see errors where node-sass still has the bindings for the last version of node.

    version: 6.9.5
    - npm rebuild node-sass