#Help with Node "Sync" and "path" methods()

5 messages · Page 1 of 1 (latest)

inner haven
#

Is there anyone out there that knows a lot about Sync and path methods in Node? Because I'm working on this small project that creates a react app to my specifications but i cant get it to work.

https://pastebin.com/KHPUY3jQ

it will get stuck on step 9 or 10, 11, because it cant find that path. Error: ENOENT: no such file or directory, open

lean cliff
#

FWIW, you should try to avoid the Sync functions. they block the event loop. if it's a simple shell script, okay. otherwise, not a good idea.

#

also suggest you use fs/promises instead of fs

#

you say it fails on step 9, so where are these files being written?

fs.writeFileSync('postcss.config.js'
fs.writeFileSync('tailwind.config.js'
fs.writeFileSync('next.config.js'

you aren't doing any path.join() for those. don't you want _app.js in the same spot?

#

ah, they're in workspacePath