Hello, I got the EMFILE error when launching the serverless “deploy” script. I used the graceful-fs package like this to solve the issue :
- install graceful-fs:
npm install graceful-fs - go to file:
node_modules/serverless/lib/plugins/package/lib/zip-service.js - replace this line :
const fs = BbPromise.promisifyAll(require('fs'));
by this:
var realFs = require('fs')
var gracefulFs = require('graceful-fs')
gracefulFs.gracefulify(realFs)
const fs = BbPromise.promisifyAll(realFs);