[ERROR] Gulpfile not found: ./gulpfile.js


#1

Hi,
I’ve the same problem after upgrading ionic/cli-utils from 1.3 to 1.4.0
If I launch “ionic serve” or “ionic cordova build ios” I obtain same error of rivetly:

[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

My ionic info:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 7.0.1
    Gulp CLI         : CLI version 1.3.0 Local version 3.9.1
    Ionic CLI        : 3.4.0

local packages:

    @ionic/cli-plugin-cordova : 1.4.0
    @ionic/cli-plugin-gulp    : 1.0.1
    @ionic/cli-plugin-ionic1  : 2.0.0
    Cordova Platforms         : android 5.1.1 browser 4.1.0 ios 4.4.0
    Ionic Framework           : ionic1 1.3.1

System:

    Node       : v6.10.3
    OS         : OS X El Capitan
    Xcode      : Xcode 7.3.1 Build version 7D1014
    ios-deploy : 1.9.1
    ios-sim    : 5.0.13
    npm        : 3.10.10

I’ve tried the suggestions of rivetly but no success.
Thanks in advance


Gulpfile not found: ./gulpfile.js
#2

Do you use gulp in your project?
When and why did you install @ionic/cli-plugin-gulp?
If you don’t use it, did you try the command the error message told you to?


#3

Hi Sujan and thanks for reply.
Even if I try to remove cli-plugin-gulp it with

sudo npm uninstall --save-dev --save-exact @ionic/cli-plugin-gulp@latest

I obtain the same previous error:

[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’ve always used gulp in my project since I started working on it, without problems until yesterday


#4

Post you package.json content please.


#5

this is my package.json:

{
	"name": "myAppName",
	"version": "1.1.1",
	"description": "myAppName: An Ionic project",
	"dependencies": {
		"@ionic/cli-plugin-cordova": "^1.3.0",
		"angular-moment": "^1.0.0-beta.6",
		"cordova-browser": "^4.1.0",
		"cordova-ios": "^4.4.0",
		"gulp": "^3.5.6",
		"gulp-concat": "^2.2.0",
		"gulp-minify-css": "^0.3.0",
		"gulp-rename": "^1.2.0",
		"gulp-sass": "^2.0.4",
		"moment": "^2.14.1",
		"phonegap-facebook-plugin": "file:///Users/popix/Apps/phonegap-facebook-plugin"
	},
	"devDependencies": {
		"@ionic/cli-plugin-cordova": "1.4.0",
		"@ionic/cli-plugin-gulp": "1.0.1",
		"@ionic/cli-plugin-ionic1": "2.0.0",
		"bower": "^1.3.3",
		"gulp": "^3.9.1",
		"gulp-concat": "^2.6.1",
		"gulp-minify-css": "^0.3.13",
		"gulp-rename": "^1.2.2",
		"gulp-sass": "^2.3.2",
		"gulp-util": "^2.2.20",
		"shelljs": "^0.3.0"
	},
	"cordovaPlugins": [
		"cordova-plugin-device",
		"cordova-plugin-console",
		"cordova-plugin-whitelist",
		"cordova-plugin-splashscreen",
		"cordova-plugin-statusbar",
		"ionic-plugin-keyboard",
		"cordova-plugin-inappbrowser",
		"ionic-plugin-deploy",
		{
			"variables": {
				"SENDER_ID": "1470584142746"
			},
			"locator": "phonegap-plugin-push",
			"id": "phonegap-plugin-push"
		}
	],
	"cordovaPlatforms": [
		"ios",
		"android"
	],
	"cordova": {
		"plugins": {
			"phonegap-facebook-plugin": {
				"APP_ID": "968795099929158",
				"APP_NAME": "myAppName"
			}
		},
		"platforms": [
			"browser",
			"ios"
		]
	}
}

#6

That looks correct.

I think you should report an issue here:
https://github.com/ionic-team/ionic-cli/issues


#7

Ok, why is this still there after you uninstalled it before?


#8

I don’t know why is this still there, I’ve just now removed it manually from package.json but nothing changes, same error.


#9

I got the same Issue and made the following steps:

edit the file ionic.config as follows:

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

also add this to your gulpfile.js:

gulp.task(‘default’, [‘sass’]);
gulp.task(‘serve:before’, [‘default’]);

Also make sure your ionic info shows the following while your in the app directory:

global packages:

@ionic/cli-utils : 1.4.0
Cordova CLI      : 7.0.1
Gulp CLI         : **not installed globally**
Ionic CLI        : 3.4.0

local packages:

@ionic/cli-plugin-cordova : 1.4.0
@ionic/cli-plugin-gulp    : 1.0.1
@ionic/cli-plugin-ionic1  : **2.0.0**
Cordova Platforms         : android 6.1.2
Ionic Framework           : ionic1 1.3.1

System:

Node       : v6.11.0
OS         : Windows 10
Xcode      : not installed
ios-deploy : not installed
ios-sim    : not installed
npm        : 5.0.3

I hope this helps! Good Luck!


#10

Does not work for me :disappointed_relieved:


#11

Thanks to jacobriprap,
with:

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

I’ve just solved my problem!


#12

Don’t works for me

global packages:

@ionic/cli-plugin-proxy : 1.3.1
@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
@ionic/cli-plugin-gulp    : 1.0.1
@ionic/cli-plugin-ionic1  : 2.0.0
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

#13

I encountered into the same problem, and after many unsuccessful tries, I added one line to node_modules/@ionic/cli-plugin-gulp/index.js:

if (e.code !== 'MODULE_NOT_FOUND') {
     throw e;
}

console.dir(e); // ADD THIS

throw new cli_utils_1.FatalException(`Gulpfile not found: ${chalk.bold(cli_utils_1.prettyPath(gulpFilePath))}\n` +
                `You can set the ${chalk.bold('gulpFile')} attribute in ${chalk.bold(cli_utils_1.PROJECT_FILE)} for custom Gulpfile locations, otherwise the default Ionic Gulpfile can be downloaded from ${chalk.bold('https://github.com/ionic-team/ionic-app-base/blob/master/gulpfile.js')}\n\n` +
                `Or, if you no longer use gulp, you can remove the CLI Gulp Plugin:\n\n` +
                `    ${chalk.green(gulpPluginUninstallArgs.join(' '))}`);

then run ionic serve again, the console can print out why it fails, we could try to resolve them now.

In my case, it’s because of some missing gulp related packages (gulp-bower gulp-minify-css gulp-rename gulp-concat)

We should consider more accuarate error output instead of misleading Gulpfile not found for every error.


#14

Awesome @sfc, could you create an issue at https://github.com/ionic-team/ionic-cli/issues please? I think that should be implemented or improved.


#15

opened an issue at https://github.com/ionic-team/ionic-cli/issues/2465


#16

I also had the same problem, then I used command:gulp to test my project, and I got a new exception:

Error: Cannot find module ‘replace’

I recognized I haven’t installed “replace” module, just installed it

npm install replace -g
npm install replace

Rerun the gulp command, it worked.
Rerun the ionic serve commane, it also worked.


#17

That is a workaround - you should find out what library is requiring replace and didn’t add it to its package.json file - otherwise you will have the exact same error again every time you check out the project on a new computer.


#18

@Sujan12 Yes, in my project , I have gulpfile.js file, so I know this exception tip :

[ERROR] Gulpfile not found: ./gulpfile.js

is not right, so I used gulp command to test my project, then I got the right tip :

Error: Cannot find module ‘replace’