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.

fs.readdir returns file 'dist' with 3.0.0-beta.11

See original GitHub issue

Is this a BUG or a FEATURE REQUEST?: BUG

What happened: When running fs.readdir for a certain directory path, let’s say /example/dir, if I run the nexe application from under that same directory path, let’s say /example/dir/testNexe, fs.readdir will return a dist file that does not exist. This is the path returned by fs.readdir:

/example/dir/testNexe/dist

What you expected to happen: fs.readdir should not return a file that does not exist when running the nexe app from a directory under the one passed to fs.readdir

How to reproduce it (as minimally and precisely as possible):

  • Call fs.readdir with a path (i.e. /example/dir) in a packaged nexe application
  • Log result returned from fs.readdir
  • Run the nexe application from a directory under /example/dir (i.e. /example/dir/testNexe)
  • /example/dir/testNexe/dist is logged and should not.

Anything else we need to know?:

  • This doesn’t happen when running the nexe application from a directory not under the directory passed to fs.readdir
  • This doesn’t happen with nexe 2.0.0-rc.34
  • This is happening on both OSX Mojave and Debian 7.

Environment

  • Platform(OS/Version): OSX Mojave, Debian 7
  • Host Node Version: 8
  • Target Node Version: 8
  • Nexe version: 3.0.0-beta.11
  • Python Version: 2.7.10

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:2
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
ArashMotamedicommented, Jan 28, 2020

fs.promises.readdir works!

1reaction
anmonteirocommented, Apr 9, 2019

I tried with 3.0.5 and it produced the same results btw.

Read more comments on GitHub >

github_iconTop Results From Across the Web

fs.readdir / fs.readdirSync do not list correct files #453 - GitHub
When trying to list files in a directory with fs.readdir or fs. ... fs.readdir returns file 'dist' with 3.0.0-beta.11 nexe/nexe#571.
Read more >
Node.js fs.readdir() Method - GeeksforGeeks
readdir () method is used to asynchronously read the contents of a given directory. The callback of this method returns an array of...
Read more >
File system | Node.js v19.3.0 Documentation
Returns a ReadableStream that may be used to read the files data. An error will be thrown if this method is called more...
Read more >
Node.js: fs.readdir does not return a file written by fs.writeFile
A simple Node.js http server which creates files in a given directory by calling POST /deploy . After the file is written, I...
Read more >
npm fails to install - Google Groups
291 verbose cache add name=undefined spec="express@~3.0.6" ... fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 ......
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