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.

Error: ENOTDIR: not a directory, scandir

See original GitHub issue

I am not sure where the issue lies, but I am using watch to watch for file changes on my js file, and when a change happens it should minifiy the js file. This works on my Ubuntu machine, but on my Windows machine, I get the error below.

> watch.cmd --interval=1 uglifyjs.cmd -c -m -o ./public/assets/js/prefab.min.js -- ./public/assets/js/prefab.js
> Watching ./public/assets/js/prefab.js
C:\Users\rnaddy\AppData\Roaming\npm\node_modules\watch\main.js:73
    if (err) throw err;
             ^

Error: ENOTDIR: not a directory, scandir 'C:\Users\rnaddy\Documents\vscode\projects\prefab\public\assets\js\prefab.js'

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

2reactions
JuanCaicedocommented, Jun 29, 2018

@mikeal I wonder how difficult it would be difficult to allow watching a file? I’m willing to help with this 👍

1reaction
JuanCaicedocommented, Jun 29, 2018

I think this comes from the fact that you’re trying to watch a file and that this tool can only watch directories. I ran into the same problem 😝

That being said, I was able to get around it by building a custom filter and then just checking for the file I want. It was relatively painless https://github.com/mikeal/watch#watchcreatemonitorroot-options-callback

Read more comments on GitHub >

github_iconTop Results From Across the Web

0 - Stack Overflow
Error : ENOTDIR: not a directory, scandir './commands/setWelcome.js' · Ask Question. Asked 1 year, 1 month ago. Modified 1 year, 1 month ago....
Read more >
ENOTDIR: not a directory, scandir ' .. /app/code/.DS_Store ...
Then I try to run baler in my root Magento project it stuck with such error: Error: ENOTDIR: not a directory, scandir '...
Read more >
ENOTDIR: not a directory Error - The freeCodeCamp Forum
hey there, I'm brand new to coding and I'm just trying to view my page and I keep getting this message in VSCode2...
Read more >
Search - appsloveworld
Coding example for the question Error: ENOTDIR: not a directory, scandir './commands/setWelcome.js'-discord.js.
Read more >
Bitbutcket sls deploy Error: ENOTDIR: not a directory, scandir
Bitbutcket sls deploy Error: ENOTDIR: not a directory, scandir · Hi, I need help with this error in bitbucket pipeline: · Operating System:...
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