Gulpfile not found: ./gulpfile.js

Dawsons-MacBook-Air:nexussocialhubappdev dawson$ ionic serve
[ERROR] Gulpfile not found: ./gulpfile.js
        You can set the gulpFile attribute in ionic.config.json for custom
        Gulpfile locations, otherwise the default Ionic Gulpfile can be
        downloaded from
        https://github.com/ionic-team/ionic-app-base/blob/master/gulpfile.js
        
        Or, if you no longer use gulp, you can remove the CLI Gulp Plugin:
        
        npm uninstall --save-dev --save-exact @ionic/cli-plugin-gulp@latest

I have completed the following tasks but still having issues getting ionic server to load.

Also this:
Ionic CLI doesn't run gulp tasks on ionic serve - #7 by agustinhaller

Hi, I think i found a solution for the issue.

Just add this to your gulpfile.js

gulp.task(ā€˜serve:beforeā€™, [ā€˜defaultā€™]);
That line tells the new ionic cli 2@beta to run the old ionic cli 1.x ā€˜defaultā€™ task before serving (before running ionic serve)

Also you need to add a ionic.config.json file with this:

{
ā€œnameā€: ā€œbase_projectā€,
ā€œapp_idā€: ā€œā€,
ā€œv2ā€: false,
ā€œtypescriptā€: false,
ā€œwatchā€: {
ā€œsassā€: [ā€œscss//*.scss"],
ā€œhtmlā€: ["www/
/.html"],
ā€œlivereloadā€: [
"www/**/
.htmlā€,
ā€œwww//*.js",
"www/
/*.cssā€
]
}
}

ā€œdependenciesā€: {
ā€œgulp-sassā€: ā€œ^2.3.2ā€
},
Uninstall gulp-sass

$ npm uninstall --save-dev gulp-sass
Reinstall gulp-sass

$ npm install --save-dev gulp-sass@2

Which one exactly is your question?
This looks like 2 posts merged into one which is a bit confusingā€¦

Sorry for lack of clarity. I provided the error message and then below that was the scripts that i did to try to rectify the problem.

Originally, i was trying to update the views/HTML but wouldnt. From what i could see is that GULP was the underlying problem.

After updating the GULP, i am not able to run Ionic serve.

Ok, reset:

Post your ionic info output please.
Is this a new project or an old one that had some custom gulp stuff in it?
When did you add the gulp plugin to Ionic CLI and why?

4 posts were split to a new topic: [ERROR] Gulpfile not found: ./gulpfile.js

It was a purchased template but unfortunately, there were a number of modules missing and i also noticed that my environments was out of date and then upgraded both node.js and npm and then modifed the packages.json. After doing that, i could install all of the required packages including gulp.

Thank you.

Before uninstalling

Package Current Wanted Latest Location
gulp-concat MISSING 2.6.1 2.6.1 ecommerce2
gulp-minify-css MISSING 0.3.13 1.2.4 ecommerce2
gulp-rename MISSING 1.2.2 1.2.2 ecommerce2
gulp-sass MISSING 2.3.2 3.1.0 ecommerce2

After updating whole environment node.js, npm
gulp-minify-css 0.3.13 0.3.13 1.2.4 ecommerce2
gulp-sass 2.3.2 2.3.2 3.1.0 ecommerce2

but for some reason the gulp-rename and gulp-concat are no longer listed. but fortunately eveything is functioning right now.

I had the same problem after updating node.js.

I did the following to fix it, in case someone else experience the same problem.

  1. run ā€˜npm updateā€™
  2. run ā€˜npm remove gulp-sassā€™
  3. run ā€˜npm install gulp-sass --save-devā€™

After this I can now run ionic serve again.

1 Like

Same Error
global packages:

@ionic/cli-plugin-proxy : 1.3.1-alpha.ce6c1296
@ionic/cli-utils        : 1.4.0
Cordova CLI             : 7.0.1 
Gulp CLI                : CLI version 3.9.1 Local version 3.9.1
Ionic CLI               : 3.4.0

local packages:

@ionic/cli-plugin-cordova : 1.4.0-alpha.ce6c1296
@ionic/cli-plugin-gulp    : 1.0.1
@ionic/cli-plugin-ionic1  : 2.0.0-alpha.ce6c1296
Cordova Platforms         : android 6.2.1 browser 4.1.0 ios 4.3.1
Ionic Framework           : ionic1 1.3.1

System:

Node       : v7.9.0
OS         : macOS Sierra
Xcode      : Xcode 8.3.3 Build version 8E3004b 
ios-deploy : 1.9.1 
ios-sim    : 5.1.0 
npm        : 5.0.0

You are all using Ionic v1, right? I changed the category of this topic to ā€œionic-v1ā€ then.

Mmm does not work for me :frowning:

Yes Iā€™m using ionic1 in this project where I have this error, in ionic3 donā€™t have any problem

Thank you very much!
With:

npm update
npm remove gulp-sass
npm install gulp-sass --save-dev

youā€™ve solved my problem!

2 Likes

thanks ā€¦
its work for me ā€¦

1 Like

Hi, I am a newbie in ionic please someone help ā€¦ I am stuck here for two days
cmd hit = ionic cordova build android --prod
output = [16:47:14] Cannot run sass task: missing in gulpfile.js
Thanks in advance.

Thanks. It works for me