I have set up a basic structure for creating angular templates using Gulp.
Here is the code snippet from my gulpfile
:
var gulp = require("gulp"),
templateCache = require('gulp-angular-templatecache');
gulp.task("tc", function() {
return gulp
.src("test.html")
.pipe(templateCache())
.pipe(gulp.dest("dest"));
});
Next to the gulpfile, I have a simple HTML file:
<div>
Test
</div>
However, when I run the command "gulp tc", I encounter the following error:
[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)
... (Error continues)
Despite its simplicity like a "Hello World" exercise, I am unable to get it to work. I have tried it on different operating systems without success. What could be the issue here?
On a side note, the dependencies in my package.json file are as follows:
"dependencies": {
},
"devDependencies": {
"gulp": "^3.9.1",
"gulp-angular-templatecache": "^1.8.0"
}
EDIT: Adding an empty templates.js file at the specified location resolves the issue.