500 Error: ENOENT, open "C: \ Users \ Gilbert \ Documents \ GitHub \ maths4me \ base.dust" using .js consolidation

I get this error when trying to set up inheritance in dust.js:

500 Error: ENOENT, open 'C:\Users\Gilbert\Documents\GitHub\maths4me\base.dust' 

I have an index.html file:

 {>"base.dust"/} {<title}Hi{/title} 

What causes base.dust:

 <!DOCTYPE html> <html> <head> <title>{+title}Maths 4 me{/title}</title> <link rel='stylesheet' href='/stylesheets/style.css' /> </head> <body> <h1>Hi</h1> <p>Welcome to maths4me</p> </body> </html> 
+6
source share
4 answers

Dust particles appear in the root of the application, and not in the views folder. It took me a while to figure this out. I referenced the file in the wrong folder. My code should have been:

 {>"/views/base.dust"/} {<title}Hi{/title} 
0
source

ENOENT means the file does not exist.

Check again that base.dust exists in the provided location.

+3
source

If you like it, I don’t want to constantly indicate the full path to the basic templates and partial files, try: klei-dust . (it seems to be consolidating, but only for a vacuum cleaner) In the above scenario, you can simply specify:

 {>base/} 

Instead:

 {>"views/base.dust"/} 

... to make it work.

0
source

Double check your file names. For me, I saw this error Error: ENOENT, and I noticed that in one of my main applications app.js I wrote

 app.get('/', function(req, res) { res.sendfile('./views/plan.html'); }); 

when i'm in the view folder, I renamed it to home.html, this error appears accordingly

0
source

Source: https://habr.com/ru/post/924226/


All Articles