kiliman / tailwindui-crawler

tailwindui-crawler downloads the component HTML files locally
MIT License
756 stars 94 forks source link

Error: ENOENT: no such file or directory, mkdir ... #37

Closed yabdab closed 2 years ago

yabdab commented 3 years ago

This ran good the first time, now it fails every time with this error ...

% yarn start
yarn run v1.3.2
$ node index.js
🔐  Logging into tailwindui.com...
✅  Success!

🗂   Output is ./output
⏳  Processing /components/marketing/sections/heroes...
🔍  Found 6 components
‼️   { Error: ENOENT: no such file or directory, mkdir './output/components/marketing/sections/heroes'
    at Object.fs.mkdirSync (fs.js:885:18)
    at module.exports.ensureDirExists.dir (/Users/mikeyrab/Projects/tailwindui-crawler/utils.js:23:8)
    at processComponentPage (/Users/mikeyrab/Projects/tailwindui-crawler/index.js:109:5)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
  errno: -2,
  code: 'ENOENT',
  syscall: 'mkdir',
  path: './output/components/marketing/sections/heroes' }
✨  Done in 1.10s.

The output folder is empty. The dir permissions are 777 so that is not the issue.

yabdab commented 3 years ago

Looks like it does not write the directories in order?

kiliman commented 3 years ago

Hmm... I just tried it and it worked fine for me. What is your config? Also, what happens if you call

mkdir -p ./output/components/marketing/sections/heroes

The -p creates all the intermediate folders like the API call.

image

yabdab commented 3 years ago
EMAIL=******
PASSWORD=*******
OUTPUT=/Users/mikeyrab/Projects/tailwindcss-ui-output
HTMLMODE=alpine
BUILDINDEX=1
TRANSFORMERS=addTailwindCss,prefixSrc,useInter

NOTE that I used the default ./output in my original post. It is different in the config, but still correct path.

Running mkdir -p works fine

I just added the missing folders manually and the crawler worked without issue.

¯_(ツ)_/¯

josephmasongsong commented 3 years ago

Any update on this? I am having the same issue? Thanks in advance

kiliman commented 3 years ago

Looks like it may be a node issue. I'll figure out a workaround. Thanks!

https://github.com/nodejs/node/issues/27293

kiliman commented 2 years ago

Cleaning up issues.

I believe this has been resolved. I have not heard of any more complaints.