0

Can someone help me? I am using node.JS 16.17.0 (includes npm 8.15.0). The code is working locally without errors, but not when I deploy it on Cyclic and Vercel.

This is the code -

const fs = require("fs");
const level = require("level");
const path = require("path");

fs.mkdir(path.join(__dirname, 'matic/exceptions'), {recursive: true}, (err) => { if (err) { return console.error(err);}
});
fs.mkdir(path.join(__dirname, 'matic/exceptions/eth'), {recursive: true}, (err) => {if (err) {return console.error(err);}
});
fs.mkdir(path.join(__dirname, 'matic/addresses'), {recursive: true}, (err) => {
    if (err) {return console.error(err);}
});

const dbEthExceptions = level(
    path.join(__dirname, 'matic/exceptions/eth')
);
const dbAddress = level(
    path.join(__dirname, 'matic/addresses')
);

// This is the Error //

/var/task/node_modules/level-packager/node_modules/levelup/lib/levelup.js:119
          return callback(new OpenError(err))
                          ^
    2022-09-21 17:55:36.618: Error [OpenError]: IO error: /var/task/matic/exceptions/eth/LOCK: Read-only file system
        at /var/task/node_modules/level-packager/node_modules/levelup/lib/levelup.js:119:23
        at /var/task/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
        at /var/task/node_modules/level-packager/node_modules/deferred-leveldown/deferred-leveldown.js:31:21
        at /var/task/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
        at /var/task/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
    Emitted 'error' event on LevelUP instance at:
        at /var/task/node_modules/level-packager/node_modules/levelup/lib/levelup.js:60:19
        at /var/task/node_modules/level-packager/node_modules/levelup/lib/levelup.js:119:14
        at /var/task/node_modules/abstract-leveldown/abstract-leveldown.js:38:14
        [... lines matching original stack trace ...]
        at /var/task/node_modules/abstract-leveldown/abstract-leveldown.js:38:14 {
      [cause]: undefined
    }
New contributor
Qwert zaxs is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.

0

Your Answer

Qwert zaxs is a new contributor. Be nice, and check out our Code of Conduct.

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy