IONIC error with NPM (deprecated warning) - ionic-framework

in my old ionic version i was able to run and install ionic properly.
but while creating a new project in ionic i get this error
please help me out.
C:\>ionic start
Every great app needs a name!
Please enter the full name of your app. You can change this at any time. To bypass this prompt next time, supply name,
the first argument to ionic start.
? Project name: sumith
Let's pick the perfect starter template!
Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your app. To bypass this
prompt next time, supply template, the second argument to ionic start.
? Starter template: blank
√ Preparing directory .\sumith - done!
√ Downloading and extracting blank starter - done!
Installing dependencies may take several minutes.
* IONIC DEVAPP *
Speed up development with the Ionic DevApp, our fast, on-device testing mobile app
> npm i
npm WARN deprecated circular-json#0.5.9: CircularJSON is in maintenance
only, flatted is its successor.
[ ..............] / fetchMetadata: sill resolveWithNewModule
punycode#2.1.1 checking installable status

set NODE_TLS_REJECT_UNAUTHORIZED=0 before running ionic start.

Related

How to properly convert a Vue application to Ionic 4 Vue?

I'm trying to convert an existing VueJS project to use Ionic 4 and Ionic Native plugins. It's my first time using Ionic 4 and it looks like the Ionic CLI only allows you to build Angular based apps so far. The Vue integration needs to be done manually.
The documentation I've found so far allows me to consume Ionic components but does not seem to be enough to properly setup Ionic in my project.
After going through the steps and finally adding Vue.use(Ionic) to my main entry point, running ionic --help still tells me that my project is not an Ionic project, probably because I do not have a ionic.config.json available at root level. I then run ionic init, this config file gets generated, but it is now telling me to provide the ionic:serve npm script so that it can serve my project ("type": "custom"). How can I setup all the required scripts that Ionic needs ?
I will need to have this setup to be able to add Ionic Native plugins, build my app on different platforms, etc.
I could not find any information so far neither in the docs, nor in here.
Does anyone have further information about this ?
I know it's a bit late but it can be helpful for someone else. I'm in the same situation, and yes, now it's possible. From ionic docs:
https://ionicframework.com/docs/intro/cdn#ionic-vue

Ionic - Capacitor build

I am switching my Ionic 3 application to use Capacitor. Is the a way to build the application for production using, as we did before, something like --prod?
Short answer:
In your case, run ionic build --prod, then npx cap copy and finally build the app for production in the native IDE.
Detailed answer:
This is how the Capacitor app development workflow works:
Build the web application
Run npx cap copy
Build the app in the native IDE
Building the web application happens completely separated from Capacitor. You could use any framework in the development process. What only matters is that the builded application is located in the www folder. Using Ionic, you can perform a production build by running ionic build --prod.
Afterwards, Capacitor comes to place and copies the web application in the native IDE projects, where you can perform an app build. Some platform-specific extra settings / steps are required to make the app production ready, but this again doesn't have to do with Capacitor.
Just an update:
In Ionic 4:
To do production build try this below command:
npx ng build --aot=true --configuration="production"
and do
npx cap sync
Hope it helped.

How to get Ionic Pro Deploy to download latest version on first app open

Problem
When I release a new version to the production channel in Ionic Pro Deploy (Channels) then I have to cycle my app twice in order to get the latest version. Even worse, on the first cycle my app reverts back to a far earlier version for some reason.
What I mean by cycling is, starting from a state where the application is shut down and not open, I open the app, wait for the splash screen to go away and app to be ready, and then close the app.
Question
How do I get my app to download the latest version on the very next time I open the Ionic app following my production release?
Plugin configuration
I used the plugin config from the dashboard.ionicjs.com page:
cordova plugin add cordova-plugin-ionic --save \
--variable APP_ID="[myappid]" \
--variable CHANNEL_NAME="Production" \
--variable UPDATE_METHOD="background"
Execute the command you already showed but set UPDATE_METHOD to "auto"
If you wand more control over your updating methods have a look at this:
https://ionicframework.com/docs/pro/deploy/plugin-api.html
In my case, live deploy worked correctly on a "blank" Ionic project. Live deploy also worked correctly on "my" app on iOS but not on Android.
I followed the follow steps and successfully fixed Android. However, during this process iOS suddenly had the same problem (would apply update on app install/close/open).
Set versions as per Ionic support. IonicPro live deploy currently requires these versions. Ionic are in the process of fixing this dependency:
"cordova-plugin-ionic-webview": "1.1.19",
"cordova-plugin-ionic": "4.1.7",
Install a new version of "blank" project. Update my app to use the same npm plugin versions (some of my app plugins were old).
Remove/add android platform. My hunch is this is what ultimately resolved the issue.
I wanted to try a remove/add ios platform to see if that also resolved the issue on iOS. But it was less work to ultimately switch over to IonicPro rather than re-config the local build setup.
Live deploy worked correctly on both iOS and Android after creating binaries in IonicPro.

Ionic platform add - do I need to run this every time project is checked out?

I have a team working on an ionic 2 project. Do I need to run:
ionic platform add ios
ionic platform add android
on each team members computer or is this platform configuration saved somewhere and I just need to run a command to have all the defined platforms setup?
In your updated setup, run :
ionic state save
This will add all your platform and plugin details to your package.json.
After the install in other systems, if platforms are not set,
do:
ionic state restore
No need to run every time. one time is enough, it will create supporting files first time run.

Ionic app starter project hangs on NPM install phase

When I'm trying to create a simple ionic app with 'ionic start' command, I see that ionic downloads a base app and the template indicated, but then I see 'Installing npm packages...' and it that never ends it's process (I have waited hours).
Ionic creates the myapp folder with files within it, but I don't know if it finally creates the ionic app to work with. If I put 'ionic serve' there is nothing on screen, even if I choose the tabs template.. or an error 'couldn't find ionic.config.json file'
is it a firewall issue? anyone has faced with this?
You must update your ionic to beta version using:
npm install -g ionic#beta