question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TypeError: exists is not a function

See original GitHub issue

Hi, I’m getting this error when using Level.

Console shows the error here, which is in bindings module:

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
    }

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:5
  • Comments:21 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
Twistedstcommented, Feb 9, 2017

Found that the fix is in TooTallNate/node-bindings#20 (as stated above). The PR for the commit is still open though, so it hasn’t been updated.

0reactions
arturbpcommented, Nov 13, 2020

The same here when trying to using ‘usb’ lib in ReactJS:

TypeError: exists is not a function

199 | // Avoids an infinite loop in rare cases, like the REPL 200 | dir = process.cwd(); 201 | }

202 | if ( | ^ 203 | exists(join(dir, ‘package.json’)) || 204 | exists(join(dir, ‘node_modules’)) 205 | ) {

in bindings:

… exists = (fs.accessSync && function(path) { try { fs.accessSync(path); } catch (e) { return false; } return true; }) || fs.existsSync || path.existsSync, …

node v14.15.0

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uncaught TypeError: exists is not a function #1501 - GitHub
I just imported sharp in my react project then it returns this error Uncaught TypeError: exists is not a function Function.
Read more >
exists is not a function when attempting to use serial port in ...
Uncaught TypeError: exists is not a function when attempting to use serial port in TypeScript ; require("serialport") ; var socketServer; var ; var ......
Read more >
Uncaught TypeError: exists is not a function - Google Groups
when working with modules Ceylon from JavaScript the program is running normally but in the console occurs error: Uncaught TypeError: exists is not...
Read more >
TypeError: "x" is not a function - JavaScript - MDN Web Docs
The JavaScript exception "is not a function" occurs when there was an attempt to call a value from a function, but the value...
Read more >
How to Handle JavaScript Uncaught TypeError: “x” is Not a ...
The Javascript TypeError: "x" is not a function occurs when calling a function on a value or object, which is not actually a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found