The “npm run build” step has begun throwing the following error when building on circle.ci:
Build error occurred
[Error: EMFILE: too many open files, open ‘C:\Users\circleci\project.next\export-detail.json’] {
errno: -4066,
code: ‘EMFILE’,
syscall: ‘open’,
path: ‘C:\Users\circleci\project\.next\export-detail.json’
}
I do not get the error on my local development box, or on our development or production servers. Only on Circle.ci. I have googled everything I can find on the topic and applied any relevant potential fixes, but as of yet the error is still occurring. Therefore I am reaching out to the Circle.ci community to ideas and suggestions.
Here is the relevant part of my config.yml
version: 2.1
commands:
installdependencies:
description: 'Installs dependencies and caches for reuse'
steps:
- restore_cache:
keys:
- nvm-cache-v2-18.20.4
- run:
command: |
nvm install 18.20.4
nvm use 18.20.4
- save_cache:
key: nvm-cache-v2-18.20.4
paths:
- C:\programData\nvm\v18.20.4
- restore_cache:
keys:
- node-modules-cache-v1-{{ checksum "package-lock.json" }}
- run:
command: npm I
- save_cache:
key: node-modules-cache-v1-{{ checksum "package-lock.json" }}
paths:
- ./node_modules
orbs:
win: circleci/windows@2.4.0
jobs:
build:
executor:
name: win/default
shell: bash.exe
steps:
- checkout
- installdependencies
- run:
command: npm run build
workflows:
lint-test-build-app:
jobs:
- build
Any insights or guidance would be greatly appreciated!
Thank you!