Ionic 2 & Ionic 1 work on different Node Versions

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 years ago

 

I was having some major build issues with Ionic 1.7.14 on NodeJS v6. Here you can see the problem and some of the solution that people offered me.

ionic.project has been renamed to ionic.config.json, please rename it.

For the past 6 months I have been working and two Ionic 1 Apps. earlier last month I began to work with Ionic 2. So I installed it via npm.. It all seem well I was working on Ionic 2 apps but did not quite connect the dots as to why all of the sudden I could not build anything on my past Ionic 1 apps.

FIRST SOLUTION:

I re-install Ionic 1.7.14 and I downgraded from Node 6.0 to Node 4.4.4 - voila! It was working once again! Ionic 1 was building and the CLI understood all my commands.. No more errors.

THE CONSEQUENCES:

I had to always make sure I was using Node 4.4.4 whenever I wanted to work on Ionic 1.7.x apps.. I use NVM so a simple nvm use 4.4.4 would do the trick. But when I tried to work on Ionic 2 apps I realized that Ionic 2 was no longer installed and there for had to be re-installed, again. So I did..

RE-OCCURING ISSUE:

After re-installing Ionic 2, working a bit on that app then moving on to continue working on my other Ionic 1app I realized that when I tried to run ionic serve the CLI gave me some errors which led me to believe I did not have ionic 1 installed.. WTH!? Here we go again.. re-install Ionic 1 version 1.7.x

Later I tried to ionic serve an Ionic 2 app and gulp was not running the build.. It serve the app to the browser but none of my code was being built and implemented into the app. I then realized that the CLI was not running my commands as Ionic 2 but Ionic 1.. What now? You guessed it. I had to re-install Ionic 2

THE CONNECTION between Ionic and Node versions

So yes, It took me a while to make the connection and I still don't quite understand why this is happening but I've found out that I do not need to repeatedly install Ionic versions as I wish to use them.. I just have to switch between Node Versions instead.

Ionic 2 --> works with Node 6.x Ionic 1 --> works with Node 4.4.4

As long as I am using the respective Node Version with each I have no issues. BUT is this practical? Is there something wrong with my installs and file paths? I am curious if anyone has the same issue.

profilepic.png
manpreet 2 years ago

 

The following worked for me, not sure if all the steps are necessary. I've followed these tips:

https://www.abeautifulsite.net/how-to-upgrade-or-downgrade-nodejs-using- npmhttps://forum.ionicframework.com/t/ionic2-cli-doesnt-run-gulp-tasks-on-i onic-serve/49085/6

Your system information:

Cordova CLI: 6.3.1 Gulp version: CLI version 3.9.1 Gulp local:
Local version 3.9.1 Ionic Framework Version: 1.0.0-rc.0 Ionic CLI Version: 2.1.0 Ionic App Lib Version: 2.1.0-beta.1 ios-deploy version: 1.8.5 ios-sim version: 5.0.8 OS: Mac OS X El Capitan Node Version: v4.4.4 Xcode version: Xcode 8.0 Build version 8A218a

I think the critical parts are:

  1. Edit the gulpfile.js by adding gulp.task('serve:before', ['default']);
  2. npm install --save-dev gulp-sass@2 (sudo if necessary)
  3. downgrade node to v4.4.4 (big question mark about this step)
  4. npm --production=false install (sudo if necessary)

0 views   0 shares

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.