# Adding new dependencies causes npm "cannot find module" error

**URL:** <https://discuss.circleci.com/t/adding-new-dependencies-causes-npm-cannot-find-module-error/3992>\
**Category:** Build Environment\
**Tags:** nodejs, gulp, npm\
**Created:** [May 13, 2016, 6:28pm UTC](https://discuss.circleci.com/t/adding-new-dependencies-causes-npm-cannot-find-module-error/3992 "2016-05-13T18:28:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jvincilione](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/jvincilione/32/2801_2.png) [@jvincilione](https://discuss.circleci.com/u/jvincilione)\
**Post date:** [May 13, 2016, 6:28pm UTC](https://discuss.circleci.com/t/adding-new-dependencies-causes-npm-cannot-find-module-error/3992/1 "2016-05-13T18:28:54Z")

</div>

The build works fine on heroku, and locally, and as a clean install.

Every time the build starts to run, I get the error, “Error: Cannot find module ‘rimraf’”

Looking through the npm install log, however, I see rimraf was installed. I added some new dependencies, and if I remove them, this stops breaking. However, I cannot replicate the issue on my staging server, locally or anywhere else. It only errors on here.

I’m using rimraf in a gulp file if that matters.

UPDATE:

To verify that it was the other dependencies that were somehow causing this, I removed two dependencies I recently added and npm/gulp has no issue finding the dependencies now.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:38am UTC](https://discuss.circleci.com/t/adding-new-dependencies-causes-npm-cannot-find-module-error/3992/2 "2018-06-18T11:38:21Z")

</div>


