After cloning a repo, npm install
&& ionic cordova build android --prod
shows me following error.
TypeError: Cannot read pr
Removing @angular/cli
should work for you
if not, change Typescript version to ~2.6.2
.
@angular/cli
1.7.3
works with Typescript ~2.6.2
only.
I'm using angular 5 and ionic v3. For me work these changes:
"@types/node": "^9.6.55",
"typescript": "3.7.4",
"@ionic/app-scripts": "3.2.3",
If your are using @angular/cli
or @angular-devkit
, in my case I had to remove it in order to build with --prod tag properly.
Be sure also to remove your node_modules and do npm cache clean -f
, then npm i
(maybe will be good also remove your package-lock.json)
Installing angular 9.0.0 solved the problem for me
npm install @angular/cli@9.0.0 -g
it was breaking for angular 9.1.5