Build fails with error: Cannot find module '../pack.js'


Hi I have suddenly started getting an error with my builds:

$ node --version
$ npm --version
$ nvm --version
5.58s$ npm ci
npm WARN prepare removing existing node_modules/ before installation
npm ERR! Cannot find module '../pack.js'

Where do I look for the issue? My local builds are working perfectly.

Thanks in advance.


Found it. Looks like my node_modules cache was not matching my latest dependencies. I am disabling all caching - reliability is more important to me than caching!


Wondering if there is a way to force the cache to clear rather than removing caching? (Ran into the same issue)


On the caches page for a Travis project (, there is a list of all the caches by branch and PR for the repository with a delete button to remove individual branch/PR caches, along with a Delete all repository caches button on the upper right of the page.

An alternative to deleting caches manually as needed might be to detect when the version for a dependency has changed, and have a script run that uninstalls/removes the cached dependency then reinstalls it.