Ioni-cli v6.10.1 with v1 App cannot load gulp or run sass task

I just ported and rebuilt my Ionic v1 app on a new mac and have all the latest and greatest versions of Node, NPM, Cordova, and Ionic-cli v6.10.1 etc. I am able to successfully compile my app and deploy it a simulator but when compiling from the CLI I am getting the below issues. Even though my app is still successfully compiling I am getting odd behaviors with iPhoneX/iPhone11 UI layouts where the “safe zones” notch area aren’t working properly. I think the issues might be related but I am not certain.

On my older mac, I am running Ionic cli 5.4.4 with the same GULP versions as below and the gulp files are running properly - and my UI safe zones for iPhoneX/iPhone11 are working fine.

How can I resolve this? Or am I going to have to downgrade the Ionic CLI ?

% ionic cordova build ios
> ionic-v1 build
[08:16:10] Cannot load gulp: ReferenceError: primordials is not defined
[08:16:10] Cannot load gulp: ReferenceError: primordials is not defined
[08:16:10] Cannot run sass task: missing in gulpfile.js
[08:16:10] Cannot load gulp: ReferenceError: primordials is not defined
> cordova build ios

Here is my env info:

% ionic info

Ionic:
   Ionic CLI         : 6.10.1 (/usr/local/lib/node_modules/@ionic/cli)
   Ionic Framework   : ionic1 1.0.0
   @ionic/v1-toolkit : 1.0.22

Cordova:
   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : ios 5.1.1
   Cordova Plugins   : cordova-plugin-ionic-keyboard 2.2.0, cordova-plugin-ionic-webview 5.0.0, (and 32 other plugins)

Utility:
   cordova-res : 0.15.1
   native-run  : not installed

System:
   ios-deploy : 1.10.0
   ios-sim    : 8.0.2
   NodeJS     : v14.5.0 (/usr/local/Cellar/node/14.5.0/bin/node)
   npm        : 6.14.5
   OS         : macOS Catalina
   Xcode      : Xcode 11.5 Build version 11E608c

% gulp -v
CLI version: 2.3.0
Local version: 3.9.1
1 Like

You my friend are stuck in the past like I was.

You have to migrate from gulp 3 to gulp 4.

There’s plenty of ways describe here: https://stackoverflow.com/questions/55921442/how-to-fix-referenceerror-primordials-is-not-defined-in-node
and here: https://www.sitepoint.com/how-to-migrate-to-gulp-4/

NOTE: dont do the stackoverflow ones. dont mess with node version and etc. migrate to gulp 4.

The main thing is turning whatever you had into .series and .parallel to call your tasks.

That said. I’ve done it in 3 scripts so far but I’m still having the same output as you

ionic serve
> ionic-v1 serve --host=localhost --port=8100 --livereload-port=35729 --dev-port=53703 --engine=browser
[v1] [11:04:47] Cannot load gulp: ReferenceError: primordials is not defined
[v1] [11:04:47] Serving directory www

I’ve tried:

  • to remove the global version of gulp I had installed
  • npm rebuild node-sass --force
  • npm rm gulp-sass and npm i gulp-sass
  • I can run any task just fine, like gulp default

Edit: seems “@ionic/v1-toolkit” still depends on gulp 3.9.1 and uses it when running ionic serve … I will investigate if there’s a version that uses gulp 4.0…

I too did this on my mac. I got it working about a day after my original post. My Mac is now on

CLI: 2.3.0
Local Ver: 4.0.2

However on my Windows system:

CLI: 2.3.0
Local Ver: 3.9.1

I pinned things to 3.9.1 on my windows system (for Android deployment) because too many other issues were introduced into my app and I didn’t have time to go mucking around with everything. Very soon I am going to be updating my app to Ionic 4 or 5 and most of these issues will go bye bye. But I got a LOT of code to rewrite. Not looking forward to that!

Same! I’m on ionic v1 and I will stick with it for now.

My core app.js is about 500 lines and could be re written but… :man_shrugging:t2: