Level / level

Universal abstract-level database for Node.js and browsers.
MIT License
1.55k stars 106 forks source link

ERROR Error: Uncaught (in promise): TypeError: exists is not a function #149

Closed naveed-31 closed 5 years ago

naveed-31 commented 5 years ago

I am using pcsclite (nfc-pcsc) integration in Angular 7 ...the pcsc is using binding.js file which occurs this error.

[ERROR Error: Uncaught (in promise): TypeError: exists is not a function
TypeError: exists is not a function](url)

here's the code which effects error :

exports.getRoot = function getRoot(file) {
  var dir = dirname(file),
    prev;
  while (true) {
    if (dir === '.') {
      // Avoids an infinite loop in rare cases, like the REPL
      dir = process.cwd();
    }
    if (
      exists(join(dir, 'package.json')) ||
      exists(join(dir, 'node_modules'))
    ) {
      // Found the 'package.json' file or 'node_modules' dir; we're done
      return dir;
    }
    if (prev === dir) {
      // Got to the top
      throw new Error(
        'Could not find module root given file: "' +
          file +
          '". Do you have a `package.json` file? '
      );
    }
    // Try the parent dir next
    prev = dir;
    dir = join(dir, '..');
  }
};
vweevers commented 5 years ago

As mentioned in https://github.com/Level/level/issues/34#issuecomment-500730995, this doesn't seem to be related to level. You'll probably want to open an issue here instead: https://github.com/santigimeno/node-pcsclite