TypeError: exists is not a function
See original GitHub issueHi, 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:
- Created 8 years ago
- Reactions:5
- Comments:21 (11 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.
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 | }
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