Has anyone found documentation or CLI help on how to build for browser in production? There seem to be official commands only for iOS and Android, not for Browser as platform.
Is this the correct command to build for the browser platform in production (Ionic 3)?
ionic cordova build browser --prod --release
I also want to use some Cordova plugins in production for the browser platform…
The Cordova browser platform is not officially supported by Ionic, that’s why there are no documented commands. PWA or web apps officialy are build using ionic build and ionic build --prod.
But the command you posted should work just fine when you only use Cordova plugins that have proper, full fledged browser support.
What is the recommended way to upgrade Ionic CLI? I see that many get problems when upgrading and even need to delete and reinstall Cordova, Ionic, npm and node… How do I avoid that?
You might not be able to. It depends how correctly you installed previous versions. If you haven’t installed nvm yet, I recommend you do that now, to manage your Node installation. It makes Ionic updates much simpler.
Run ionic info and do what it tells you to - it normally recognizes updates. Otherwise just run npm install -g ionic and then ionic info, it will trigger the following updates or removals…
I did that now. How much of what the changelog say shall I really do? Like of below:
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\watchpack\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
npm WARN @ionic/app-scripts@1.3.7 requires a peer of @angular/core@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of @angular/compiler@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of @angular/compiler-cli@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of @angular/tsc-wrapped@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of rxjs@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of sw-toolbox@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of typescript@* but none was installed.
npm WARN @ionic/app-scripts@1.3.7 requires a peer of zone.js@* but none was installed.
npm WARN tslint@3.15.1 requires a peer of typescript@>=1.7.3 but none was installed.
On Ionic info I now get:
D:\vdrive\web\map\hpm>ionic info
[ERROR] Error with .\node_modules\ionic-angular\package.json file: FILE_NOT_FOUND
That is not the changelog, but the output of the install process.
The installation also didn’t work, see the identical app-scripts version in ionic info.
Also something else broke as it doesn’t recognize Ionic Framework vesion any more.
I think this is beyond saving.
One solution: Uninstall your node, install nvm (or nvm-windows when you are using Windows), install a new node with this, then install ionic and cordova again and try your command again. The problem should be gone.