Ionic framework: Error after updating ionic version to 4 - ionic-framework

I’ve this issue after updating ionic version. I cant even start my ionic project. Is there anyone who can help me through this. Thank you. since I cant use ionic info, I just list npm to show what I've so far.
$ npm list -g --depth=0
/Users/phyopwintthu/.nvm/versions/node/v10.10.0/lib
├── cordova#8.0.0
├── hoek#5.0.4
├── ionic#4.1.2
├── npm#6.4.1
├── socks#2.2.1
└── ws#3.3.2
> $ ionic events.js:167
> throw er; // Unhandled 'error' event
> ^
>
> TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of
> type string or Buffer. Received type object
> at validChunk (_stream_writable.js:258:10)
> at WriteStream.Writable.write (_stream_writable.js:292:21)
> at process.<anonymous> (/Users/phyopwintthu/.nvm/versions/node/v10.10.0/lib/node_modules/ionic/bin/ionic:9:63)
> at process.emit (events.js:182:13)
> at emitPromiseRejectionWarnings (internal/process/promises.js:105:20)
> at process._tickCallback (internal/process/next_tick.js:69:34) Emitted 'error' event at:
> at validChunk (_stream_writable.js:261:12)
> at WriteStream.Writable.write (_stream_writable.js:292:21)
> [... lines matching original stack trace ...]
> at process._tickCallback (internal/process/next_tick.js:69:34)

You can try this;
npm uninstall -g ionic#4
and later
npm install -g ionic#3
and also if you want to change your ionic version, you can check Upgrade Link

Related

missing android.jar when I try to run flutter project

Hey I try to run a project but it keeps showing that a android.jar is missing. What can I do ?
Launching lib\main.dart on SM G970F in debug mode...
FAILURE: Build failed with an exception.
* What went wrong:
A problem was found with the configuration of task ':app:processDebugResources'.
> File 'C:\Users\adamr\AppData\Local\Android\sdk\platforms\android-28\android.jar' specified for property 'androidJar' does not exist.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 12s
This issue occurs when your platform SDK have missing android.jar file.
Download android.jar file and paste into directory of your plateform SDK from
https://github.com/Sable/android-platforms
It solved my problem in my Linux. Iam sure it will work on Windows as well✌️.
It seems to be a problem with your Android SDK. Try going to Android Studio, Check if you have installed all the required SDK, must times running flutter doctor -v will show you that.
If flutter doctor is fine then I recommend that you uninstall the current android SDK and re-install it.
Your android sdk is incomplete. Try install it from Android Studio SDK manager. The folder should looks like the following:
/Users/shooding/Library/Android/sdk/platforms/android-28/
├── android-stubs-src.jar
├── android.jar
├── build.prop
├── data
├── framework.aidl
├── optional
├── package.xml
├── sdk.properties
├── skins
├── source.properties
├── templates
└── uiautomator.jar

Ionic4 Unknown browser query

I have practised Ionic a lot so these Problems are not new for me but I am unabale to solve this one.
I am currently trying to migrate my Ionic3 project to Ionic4.
To do this I have created a new Ionic4 tabs project.
Every time I try the Ionic serve command I am getting:
[ng] An unhandled exception occurred: Unknown browser query
basedir=$(dirname "$(echo "$0" | sed -e 's
Maybe you are using old Browserslist or made typo in query.
[ng] See "C:\Users\Admin\AppData\Local\Temp\ng-9er5Id\angular-errors.log" for further details.
[ERROR] ng has unexpectedly closed (exit code 127).
The Log file:
[error] BrowserslistError: Unknown browser query `basedir=$(dirname "$(echo "$0" | sed -e 's`. Maybe you are using old Browserslist or made typo in query.
at unknownQuery (D:\Wisex\Technik\Client\safehome_client\node_modules\browserslist\index.js:204:10)
at D:\Wisex\Technik\Client\safehome_client\node_modules\browserslist\index.js:296:11
at Array.reduce (<anonymous>)
at resolve (D:\Wisex\Technik\Client\safehome_client\node_modules\browserslist\index.js:237:18)
at browserslist (D:\Wisex\Technik\Client\safehome_client\node_modules\browserslist\index.js:361:16)
at new BuildBrowserFeatures (D:\Wisex\Technik\Client\safehome_client\node_modules\#angular-devkit\build-angular\src\utils\build-browser-features.js:17:35)
at generateWebpackConfig (D:\Wisex\Technik\Client\safehome_client\node_modules\#angular-devkit\build-angular\src\utils\webpack-browser-config.js:24:34)
at process._tickCallback (internal/process/next_tick.js:68:7)
at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Does anyone of you have an possible solution for this.
I am really greatful for help cause I takes my days to migrate by now.
Yours,
Benjamin
Do you have the last version of the angular cli?
npm install -g #angular/cli
It might also be useful to post the log
I have spent several hours to fix this .Hope it will help someone
Kindly follow the below steps:
find your npm path from the environmental variable. And copy that path and paste it in notepad
2.Go to control panel ->uninstall the node js
3.after uninstalling,restart the system.
4.Now go to npm path in file explorer.
5.And delete the folder named npm and npm-cache
6.And now install the node(LTS version) and angular(refer from the below link for step by step installation)
https://www.zeolearn.com/magazine/setup-angular-windows
note:Dont run the cmd as administrator.Unless ,the installation fails
7.Once you verified that angular is running fine using ng serve -o
8.Install the ionic by npm install -g ionic#latest
9.And run ionic serve.
10.Hope it helps.Happy coding :)

Unable to create ionic app with Ionic Start, receiving Unexpected end of JSON error

I'm trying to create a new ionic app using ionic start, when I provide a project name the installation begins but I received the below error in the VS Code console:
> npm.cmd i
npm ERR! Unexpected end of JSON input while parsing near '...{"mocha":"~1.12.0","c'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\11342\AppData\Roaming\npm-cache\_logs\2019-09-03T19_10_04_787Z-debug.log
[ERROR] An error occurred while running subprocess npm.
npm.cmd i exited with exit code 1.
Can someone please tell me what may be causing this issue, & how it can be resolved?

angular4 data table Error as ./node_modules/angular-4-data-table/src/index.ts

Im getting error as after i install datatabel npm install angular-4-data-table --save
ERROR in ./node_modules/angular-4-data-table/src/index.ts
Module build failed: Error: C:\SOFT\Angular\Angular\node_modules\angular-4-data-table\src\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
You are certenly using a higher version of angular which is not well organised with angular-data-table4 then upgrade for 5 version of the grid :
npm install angular5-data-table --save
and in App Module use:
import {DataTableModule} from 'angular5-data-table';
use in component
import { ... } from 'angular5-data-table';
it worked for me

Ionic 2: ionic serve resulting in white/blank page

I have installed Ionic2 today and tried several starter projects. Each time ionic serve gives a blank (white) browser screen with no build or console errors. No edits have been made to the starter code.
app.bundle.js is truncated:
> (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof
> require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return
> i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw
> f.code="MODULE_NOT_FOUND",f}var
> l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var
> n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return
> n[o].exports}var i=typeof require=="function"&&require;for(var
> o=0;o<r.length;o++)s(r[o]);return
> s})({1:[function(require,module,exports){
>
> },{}],2:[function(require,module,exports){
> arguments[4][1][0].apply(exports,arguments) },{"dup":1}]},{},[1,2])
>
> //# sourceMappingURL=app.bundle.js.map
And app.bundle.js.map (first part) as follows:
> {"version":3,"sources":["../../../../Documents/Apps/ionic2/testapp/node_modules/browser-pack/_prelude.js","app/app.ts"],"names":[],"mappings":"AAAA;ACAA","file":"app.bundle.js","sourceRoot":"../../../","sourcesContent":["(function
> e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof
> require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return
> i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw
> f.code=\"MODULE_NOT_FOUND\",f}var
> l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var
> n=t[o][1][e];
There are several other threads relating to 'white screens' but no solution found so far reflects my scenario.
> Ionic info:
>
> Cordova CLI: 6.3.0 Gulp version: CLI version 3.9.0 Gulp local: Local
> version 3.9.1 Ionic Framework Version: 2.0.0-beta.10 Ionic CLI
> Version: 2.0.0-beta.35 Ionic App Lib Version: 2.0.0-beta.19 OS:
> Windows 7 SP1 Node Version: v5.12.0
Solutions tried to date based on other posts:
- uninstall/reinstall ionic2 and cordova
- reinstall node.js
- running command prompt as administrator
Note: ionic serve working for older ionic1 projects.
Thanks for any insights.
Ok found the solution for anyone else who comes across this problem.
On speculation I moved my App folder further up the directory tree (thinking it might be a path length issue for the node_module files. With my App folder now running c:\Apps apps are compiling and showing in the browser.