# CircleCI CLI should ignore node\_modules but doesn't

**URL:** <https://discuss.circleci.com/t/circleci-cli-should-ignore-node-modules-but-doesnt/30129>\
**Category:** Build Environment\
**Created:** [May 1, 2019, 3:15pm UTC](https://discuss.circleci.com/t/circleci-cli-should-ignore-node-modules-but-doesnt/30129 "2019-05-01T15:15:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![DannyBrown](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/dannybrown/32/22202_2.png) [@DannyBrown](https://discuss.circleci.com/u/DannyBrown)\
**Post date:** [May 1, 2019, 3:15pm UTC](https://discuss.circleci.com/t/circleci-cli-should-ignore-node-modules-but-doesnt/30129/1 "2019-05-01T15:15:14Z")

</div>

Hi,

We are using the CircleCI CLI (version 0.1.5546+1fae6c8) locally.

We have both a `.gitignore` and a `.dockerignore` file. Both ignore `node_modules/`. Both are committed so should be picked up by the CLI. My understanding of the documentation is that this should stop the `node_modules` directory from being copied across into my test container.

Unfortunately the `node_modules` directory is still being copied across. This causes “invalid ELF header” issues if you have any native modules (such as a crypto library) as these files will have been compiled on your host machine, in my case an OS X machine, and will then attempt to run in the container, in my case an alpine linux machine. Clearly this won’t work.

It looks like this issue has been posted before but without much coming from it: [https://discuss.circleci.com/t/how-can-ignore-node-modules-on-local-builds/15386/3](https://discuss.circleci.com/t/how-can-ignore-node-modules-on-local-builds/15386/3)

This thread also appears to be relevant:  
[https://discuss.circleci.com/t/running-circleci-locally-should-allow-to-ignore-some-files/17447](https://discuss.circleci.com/t/running-circleci-locally-should-allow-to-ignore-some-files/17447)

Are there any known work-arounds or is this a bug the CircleCI team intend to fix?

Thanks,  
Danny

---

<div class="post-metadata">

**Author:** ![drazisil](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/drazisil/32/24029_2.png) [@drazisil](https://discuss.circleci.com/u/drazisil)\
**Post date:** [May 16, 2019, 1:55pm UTC](https://discuss.circleci.com/t/circleci-cli-should-ignore-node-modules-but-doesnt/30129/2 "2019-05-16T13:55:14Z")

</div>

Hi Danny,

Can you file a bug against the repo, please?

> **[CircleCI-Public/circleci-cli](https://github.com/CircleCI-Public/circleci-cli)**
>
> Use CircleCI from the command line. Contribute to CircleCI-Public/circleci-cli development by creating an account on GitHub.
