I tried the new ASP.NET vNext and I really liked the way gulp worked. I'm trying to compile LESS using gulp in an ASP.NET 4.5.2 MVC project now.
I followed this for help.
Here's what I've done so far:
Added a package.json file with the following code.
{
"name": "package",
"version": "1.0.0",
"private": true,
"devDependencies": {
"gulp": "3.9.0",
"gulp-bower": "0.0.10",
"gulp-config": "0.3.0",
"gulp-less": "3.0.3",
"gulp-plumber": "1.0.1"
}
}
Created a Gulp Task in gulpfile.js
var gulp = require('gulp');
var less = require('gulp-less');
var path = require('path');
var plumber = require('gulp-plumber');
gulp.task('less', function () {
return gulp.src('./Content/**/*.less')
.pipe(plumber())
.pipe(less({
paths: [path.join(__dirname, 'less', 'includes')]
}))
.pipe(gulp.dest('./content/'));
});
But then I get the following error (in the output window):
Failed to run "C:\Users\me\documents\visual studio 2015\Projects\projectname\Gulpfile.js"... cmd.exe /c gulp --tasks-simple 'gulp' is not recognized as an internal or external command, operable program or batch file.
I'm guessing npm din't download gulp. Any idea how to get this working?
npm install -g gulp
– harishr