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

**URL:** <https://travis-ci.community/t/build-fails-with-error-cannot-find-module-pack-js/153>\
**Category:** Travis CI Discussions & Feedback\
**Created:** [September 13, 2018, 2:40pm UTC](https://travis-ci.community/t/build-fails-with-error-cannot-find-module-pack-js/153 "2018-09-13T14:40:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![nareshbhatia](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/nareshbhatia/32/78_2.png) [@nareshbhatia](https://travis-ci.community/u/nareshbhatia)\
**Post date:** [September 13, 2018, 2:40pm UTC](https://travis-ci.community/t/build-fails-with-error-cannot-find-module-pack-js/153/1 "2018-09-13T14:40:40Z")

</div>

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

```auto
$ node --version
v10.10.0
$ npm --version
6.4.0
$ nvm --version
0.33.11
5.58s$ npm ci
npm WARN prepare removing existing node_modules/ before installation
npm ERR! code MODULE_NOT_FOUND
npm ERR! Cannot find module '../pack.js'

```

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

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![nareshbhatia](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/nareshbhatia/32/78_2.png) [@nareshbhatia](https://travis-ci.community/u/nareshbhatia)\
**Post date:** [September 15, 2018, 2:37am UTC](https://travis-ci.community/t/build-fails-with-error-cannot-find-module-pack-js/153/2 "2018-09-15T02:37:28Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![LarsLiden](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/larsliden/32/864_2.png) [@LarsLiden](https://travis-ci.community/u/LarsLiden)\
**Post date:** [January 2, 2019, 7:13pm UTC](https://travis-ci.community/t/build-fails-with-error-cannot-find-module-pack-js/153/3 "2019-01-02T19:13:12Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ryan](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/ryan/32/866_2.png) [@ryan](https://travis-ci.community/u/ryan)\
**Post date:** [January 3, 2019, 1:47am UTC](https://travis-ci.community/t/build-fails-with-error-cannot-find-module-pack-js/153/4 "2019-01-03T01:47:36Z")

</div>

On the caches page for a Travis project (`https://travis-ci.com/ORG_NAME/REPO_NAME/caches`), 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.
