Kinnard Hockenhull Kinnard Hockenhull - 6 months ago 19
Node.js Question

ENOENT, no such file or directory

I'm getting this error from my node app:

ENOENT, no such file or directory '~/Desktop/MyApp/newversion/partials/navigation.jade'


I know the file is there because when I try to open the file using the exact copied and pasted path, it works.
I also know the application is using the right directory because, well, it outputs it in the error.

Answer

Tilde expansion is a shell thing. Write the proper pathname (probably /home/yourusername/Desktop/etcetcetc) or use
process.env.HOME + '/Desktop/blahblahblah'