How to keep both ionic 1, 3, version in my system - ionic-framework

Initaially i was working with ionic 1.7.6 version with many apps. And by today some how i have changed to version 3.0.0. Now when i open my old projects under package.json i see the version as 3.0.0 instead of 1.7.6. And when i do sudo ionic build android it throws me some error to upgrade the version.
So now i have uninstall the ionic & cordova from my system.
Now i want to keep ionic 1 version 1.7.6 as well as ionic 3 version 3.0.0 how can i do it now.
so when ever i open the ionic 1 project i need to work on angularjs with ionic 1 version.
And when ever i open the project that i have created with version 3 i need to work with latest version of angular is with ionic 3..
please some one expalain me what should i need to do ??
Thank in advance !

I suspect you have installed ionic globally. If you want to run the local/project version of ionic you need to sudo ./node_modules/ionic/ionic ....
This will be the version of ionic as defined in the package.json of the project.
You can tuck this nicely away however using npm scripts (in your package.json):
e.g.
"scripts": {
"ionic": "sudo ./node_modules/ionic/ionic build "
}
Ten simply execute npm run ionic -- android

Related

ionic info command exits without any error

I got a new laptop and I installed node, ionic and angular. I added ANDROID_SDK_HOME, ANDROID_HOME and JAVA_HOME in environment. ionic version is 6.20.2, node version is v16.17.1 and angular version is 14.2.4 and npm version is 8.15.0. When I use ionic serve, application opens in browser. But when I use ionic info, it exits without any error. Same happens when I try ionic cap build android.
I had a similar error when generating the build for Android, the command ended without any error message or warning.
After many tests it was only solved by downgrading.
npm install --global #ionic/cli#6.20.1

Was Ionic 4 Beta removed from NPM?

Looks like the beta version of Ionic 4 was removed from NPM
https://www.npmjs.com/package/ionic?activeTab=versions
is this correct?
if so is it going to be added Ionic 5.beta?
You might confuse Ionic CLI (i.e. the package you link to) and #ionic/core library, which version 4.0.0-beta.0 was announced in Ionic Blog.

Ionic Live Reload not working

Live Reload has stopped working.
When I save code changes, the browser automatically refreshes, but code changes are not reflected. I need to stop my CLI and run ionic serve again in order to have any code changes reflected in the browser.
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.3.0
Ionic CLI Version: 2.1.18
Ionic App Lib Version: 2.1.9
Ionic App Scripts Version: 1.1.4
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.9.4
Xcode version: Xcode 8.2.1 Build version 8C1002
I think your problem is with your current project.So please create a new project like below.
ionic start myfirstapp blank --v2
After that see whether live reload is working or not.It should work now.
ionic serve
Note: If above one is working then you can copy/ paste your previous project's custom items where you have created to this project.Hope that solution will be much quicker than try to find a solution with the old project.That is my idea.
I did these to resolve this error on my ubuntu
Remove the npm_folder and package-lock.json files
Run npm install --save-dev
Restart your system

Ionic2 Build folder structure missing

I'm starting to learn Ionic2, I have created a new project with ionic start myproject --v2 and everything works correctly if I do ionic serve.
The build folder is missing in ionic 2 project folder.
Whenever I am trying to download any existing Ionic2 template in that one also build folder missing.
ionic -v 2.0.0-beta.30
cordova -v 6.2.0
node -v v6.2.1
npm -v 3.9.5
your ionic serve build is under www. The native builds ( from ionic build) are under platform.
A little late but I had the same issue and was able to fix it by installing Gulp :
npm install -g gulp
Then I did gulp build.
This solved my issues and generated the build folder as it was supposed to.
First you need to add support for the platform/s you are working with, by executing from Ionic CLI console:
ionic platform add android
or
ionic platform add ios
And then you should build your project by executing:
ionic build android
or
ionic build ios

Missing ionic.project file

I just updated nodejs ionic and cordova. Create new ionic project as before:
ionic start myApp blank
In terminal, go to myApp directory, and input:
ionic state
I got message:
You cannot run any state commands on a project that is not an Ionic
project. Try adding an ionic.project file or running ionic start to
get an application to save or restore (CLI v1.7.10)
My system information:
Cordova CLI: 5.4.0
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.10
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.3
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.1.0
Xcode version: Xcode 7.1.1 Build version 7B1005
Question: Where ionic.project file, I don't remember there was this file in project before. How to add ionic.project file?
How do I find this problem? Because I check out source from git, I try to use ionic state restore command to restore application for building. But I got same message, missing ioinc.project. So I create a new ionic project to find reason, but I'm still confused.
If use
ionic start
You will got
Invalid command (CLI v1.7.10)
Of course, there is not directory argument for this command. If you give directory as ./, this command only create and overwrite all project file.
screen shot
The new name of this file is ionic.config.json
I was facing the same issue.
just run the command
ionic serve
ionic.project file gets auto generated
EDIT
ionic.project is replace by ionic.config.json. So you should change in ionic.config.json
If you are happened to use ionic#beta, it won't install it until you downgrade it to ionic V1 then "ionic setup sass" or "ionic serve".
Most simple/easy solution to this problem to install a chrome extension named CORS. and everything will work perfectly.