2016-06-17 18 views
11

Ho questa configurazione di base per la costruzione dei miei modelli angolari.gulp-angular-templatecache nessun file o directory, errore lstat 'templates.js'

Questa è la gulpfile

var gulp = require("gulp"), 
    templateCache = require('gulp-angular-templatecache'); 

gulp.task("tc", function() { 
    return gulp 
     .src("test.html") 
     .pipe(templateCache()) // when I comment out this line I see test.html file is getting copied under dest folder 
     .pipe(gulp.dest("dest")); 
}); 

Si tratta di un semplice file HTML che si trova accanto al gulpfile.

<div> 
    Test 
</div> 

Quando si esegue "gulp tc", viene visualizzato l'errore.

[17:49:19] Using gulpfile ~SOME_PATH/gulpfile.js 
[17:49:19] Starting 'tc'... 
fs.js:839 
    return binding.lstat(pathModule._makeLong(path)); 
       ^

Error: ENOENT: no such file or directory, lstat '/SOME_PATH/templates.js' 
    at Error (native) 
    at Object.fs.lstatSync (fs.js:839:18) 
    at DestroyableTransform.TransformStream [as _transform] (/SOME_PATH/node_modules/gulp-angular-templatecache/node_modules/gulp-header/index.js:38:12) 
    at DestroyableTransform.Transform._read (/SOME_PATH/node_modules/gulp-angular-templatecache/node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:159:10) 
    at DestroyableTransform.Transform._write (/SOME_PATH/node_modules/gulp-angular-templatecache/node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:147:83) 
    at doWrite (/SOME_PATH/node_modules/gulp-angular-templatecache/node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:313:64) 
    at writeOrBuffer (/SOME_PATH/node_modules/gulp-angular-templatecache/node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:302:5) 
    at DestroyableTransform.Writable.write (/SOME_PATH/node_modules/gulp-angular-templatecache/node_modules/gulp-header/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:241:11) 
    at write (/SOME_PATH/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:623:24) 
    at flow (/SOME_PATH/node_modules/gulp-concat/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:632:7) 

Questo è semplice come un esercizio "Hello World" ma non riesco a farlo funzionare. Ho provato su mac-os, ubuntu e windows machine senza fortuna, sempre lo stesso errore. Dove sto andando male?

BTW, le dipendenze nel pacchetto.json sono simili a questa.

"dependencies": { 
    }, 
    "devDependencies": { 
    "gulp": "^3.9.1", 
    "gulp-angular-templatecache": "^1.8.0" 
    } 

MODIFICA: Se aggiungo un file templates.js vuoto a quello che cerca, funziona.

+0

In questo momento sto avendo l'errore esatto, mi fa impazzire. Spero che possa darmi la risposta .... –

risposta

Problemi correlati