How to avoid ENOSPC errors in Circle CI with React Native?



#!/bin/bash -eo pipefail
npm test
npm info it worked if it ends with ok
npm info using npm@4.2.0
npm info using node@v7.10.0
npm info lifecycle mobile@0.1.0~pretest: mobile@0.1.0
npm info lifecycle mobile@0.1.0~test: mobile@0.1.0

mobile@0.1.0 test /home/circleci/pwf/mobile
node node_modules/jest/bin/jest.js --watch

jest-haste-map: duplicate manual mock found:
Module name: ErrorUtils
Duplicate Mock path: /home/circleci/pwf/mobile/node_modules/react-native/node_modules/fbjs/lib/mocks/ErrorUtils.js
This warning is caused by two manual mock files with the same file name.
Jest will use the mock file found in:
Please delete one of the following two files:

throw error;

Error: watch /home/circleci/pwf/mobile/node_modules/react-native-maps/lib/android/build/tmp/expandedArchives/classes.jar_d2abcbdjgn1vngoezjf034het/com/google/android/gms/common/internal ENOSPC
at exports._errnoException (util.js:1050:11)
at FSWatcher.start (fs.js:1398:19)
at (fs.js:1424:11)
at NodeWatcher.watchdir (/home/circleci/pwf/mobile/node_modules/jest-haste-map/node_modules/sane/src/node_watcher.js:150:20)
at Walker. (/home/circleci/pwf/mobile/node_modules/jest-haste-map/node_modules/sane/src/node_watcher.js:374:12)
at emitTwo (events.js:106:13)
at Walker.emit (events.js:194:7)
at /home/circleci/pwf/mobile/node_modules/walker/lib/walker.js:69:16
at go$readdir$cb (/home/circleci/pwf/mobile/node_modules/graceful-fs/graceful-fs.js:149:14)
at FSReqWrap.oncomplete (fs.js:114:15)
npm info lifecycle mobile@0.1.0~test: Failed to exec test script
npm ERR! Test failed. See above for more details.
Exited with code 1


Hello @kaiyuanneo,

Thanks for your report.

Could you please send us a build link which demonstrates the issue?

Does this happen often, as in every/other build?


This happened regularly when our test script was node node_modules/jest/bin/jest.js --watch. I removed the --watch and CI worked successfully. I suspect it was because the project had so many node_modules and was trying to watch all of them and the default CircleCI config did not allow so many watches.

Non blocking for me now.


Asking similar / same question here. I guess the only option is to remove the --watch… ?


This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.