In this post we are going to discuss about how to solve no gulpfile found error. In our previous post we have explained about Configuring System for using TypeScript where we have explained how to install gulp (A JavaScript Task Runner).
Now after installing gulp using npm install gulp -g when you run gulp in the command line you might get an error as No gulpfile found error.
This error means that gulp doesn't find gulpfile.js to follow the instructions. To solve this error we simply need to add gulpfile.js to our directory root by running the command
touch gulpfile.js
Now after adding gulpfile.js if we run gulp command again we will get a new error, Task 'default' is not in your gulpfile, as shown below.
The above error means that we do not have a default task in our gulpfile.js. Every gulpfile needs a default task to run when gulp is executed without any arguments. So we are going to add a default task in our gulpfile.
var gulp = require('gulp');
gulp.task('default', function () { console.log('Hello Gulp!') });
Now when we run the gulp command we get the following output. Thus our gulp process is up and running.
Please Like and Share the CodingDefined.com Blog, if you find it interesting and helpful.
Now after installing gulp using npm install gulp -g when you run gulp in the command line you might get an error as No gulpfile found error.
This error means that gulp doesn't find gulpfile.js to follow the instructions. To solve this error we simply need to add gulpfile.js to our directory root by running the command
touch gulpfile.js
Now after adding gulpfile.js if we run gulp command again we will get a new error, Task 'default' is not in your gulpfile, as shown below.
The above error means that we do not have a default task in our gulpfile.js. Every gulpfile needs a default task to run when gulp is executed without any arguments. So we are going to add a default task in our gulpfile.
var gulp = require('gulp');
gulp.task('default', function () { console.log('Hello Gulp!') });
Now when we run the gulp command we get the following output. Thus our gulp process is up and running.
Please Like and Share the CodingDefined.com Blog, if you find it interesting and helpful.
Thanks. I was breaking my head on this - didn't know the file has to be named in a certain way (gulpfile.js) - thanks much.
ReplyDeleteThanks
ReplyDeleteWorking great
That was cristal clear. Thanks so much!
ReplyDeleteThank you!
ReplyDeletegulp.js = No go. gulpfile.js = Everythings just fine.
ReplyDeleteThanks!
Thank you. That helped me to get started with gulp :)
ReplyDeleteThank. This was helpful.
ReplyDeletegetting error "'touch' is not recognized as an internal or external command,
ReplyDeleteoperable program or batch file."
getting error "'touch' is not recognized as an internal or external command
Deletedid u resolve it...? Even m getting the same error
create the file by yourself that gonna work
Deleteawesome man
ReplyDeleteit didn't work still getting the error Task 'default' is not in your gulpfile . I have a default task set in gulp.js but still ....
ReplyDeleteyou are great ! thx
ReplyDeleteThank you very much
ReplyDeletethanks
ReplyDelete