ENOENT Error building with Gulp

376 views
Skip to first unread message

Keith Lesser

unread,
Apr 13, 2015, 2:43:11 PM4/13/15
to duran...@googlegroups.com

Attempting to build with gulp-durandal.   I've followed the instructions on the durandal site.  When I run gulp durandal I am consistently gettting the following.  I realize that gulp is looking for a js file called css but I do not define such a file anywhere and can't track down where it is looking for this file.  I've tried minify:false and almond:false and still get the error.  This is a .NET backend. We've by and large ignored Razor.   Anyone seen this?

note: 'xxx' is mine.  Path is correct for the application in the error message

Durandal Error: ENOENT, no such file or directory 'C:\xxx\xxx\xxx
.WebApp\app\css.js'
    at Error (native)



Here's my gulpfile:

gulp.task('durandal', function(){
   
return durandal()
   
.pipe(gulp.dest('./output'));
});

I don't get any better info when including 'verbose:true',


Robert Greyling

unread,
Apr 13, 2015, 4:56:18 PM4/13/15
to Keith Lesser, duran...@googlegroups.com
Hey Keith,

I can't see anything specifically wrong with what you've shown, but that's not very much so there may be something we've missed. I've written a tutorial on this exact process with all the code for you to see. Perhaps it will show you something different to your code and you might spot the problem. This works perfectly for me:


Hope that helps,
Rob



--
You received this message because you are subscribed to the Google Groups "DurandalJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to durandaljs+...@googlegroups.com.
Visit this group at http://groups.google.com/group/durandaljs.
To view this discussion on the web visit https://groups.google.com/d/msgid/durandaljs/29386d64-f1ab-4d67-9c96-210b08d46b6f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Keith Lesser

unread,
Apr 13, 2015, 6:16:08 PM4/13/15
to duran...@googlegroups.com, keith....@gmail.com
Thanks for your reply, Rob.  I think I was more asking about the specific error.  I have also tried more explicit gulp-durandal configurations but continue to receive this particular error which I can't make heads or tails of.  Short of posting my entire codebase not sure how much more code I could post.  I am really just am not sure where to search for the cause of this non-existent-file error.  I am fairly new to node and gulp, so I might not be posting some crucial bit of info that would make this all clear to the reader. 

David

unread,
Aug 31, 2015, 9:06:20 AM8/31/15
to DurandalJS, keith....@gmail.com
Hi Keith,

This issue occurs if there are any .css files in the app folder.

In the example Rob links to the .css files are in the content folder, which is why it works in Rob's example.

You have 3 options:
  1. move your .css files out of the app folder
  2. pass the pluginMap config option, and don't list .css -- you can see the defaults at: https://github.com/welldone-software/gulp-durandal/blob/4eacd22fcc567a372e04e6de443b0228572d6400/index.js#L27
  3. get a pull request into Durandal to change its behaviour
In the project I'm working on, I went with option 2, here's the code:

durandal({
            almond: true,
            minify: true,
            pluginMap: {
                '.html': 'text'
            }
        })

I hope this helps,

David

Keith Lesser

unread,
Aug 31, 2015, 3:03:20 PM8/31/15
to DurandalJS, keith....@gmail.com
Thanks.  Yeah, I figured that out.  I had a plugin that had its own css.  Once I moved the plugin out of the App(shouldn't have been there anyway) everything worked fine. 
Reply all
Reply to author
Forward
0 new messages