Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 514
Kinnard Hockenhull Avatar asked Dec 24 '13 01:12

Kinnard Hockenhull


People also ask

What does error Enoent mean?

It's an abbreviation of Error NO ENTry (or Error NO ENTity), and can actually be used for more than files/directories. It's abbreviated because C compilers at the dawn of time didn't support more than 8 characters in symbols. Follow this answer to receive notifications. edited Jun 4, 2019 at 14:30. community wiki.


2 Answers

I believe the previous answer is the correct answer to this problem but I was getting this error when I tried installing npm package (see below) :

enter image description here

The fix for me was : npm init --yes

enter image description here

like image 158
grepit Avatar answered Sep 19 '22 21:09

grepit


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

like image 38
hobbs Avatar answered Sep 22 '22 21:09

hobbs