Interface.d.ts error after upgrading to latest ionic v4 beta (12)

I am working on a project that was created using Ionic v4.0.0-beta.3

I hit a bug that was fixed in beta.12, so I updated to beta.12 (the method I used was to do npm remove -g ionic, followed by npm install -g ionic)

Deleted node_modules folder and ran npm install to install all dependencies again.

Now when I do Ionic serve I get:
ERROR in node_modules/@ionic/core/dist/types/interface.d.ts(41,42): error TS1005: ‘;’ expected.

I googled around and saw that this is due to typescript being an old version, but my typescript version is 3.1.1

Any idea how to fix this?
(note: I’m new to Ionic and I’m not sure if the way I upgraded the Ionic version was the “proper” way of doing it… Is there any step-by-step guide on how all this updating should be done? e.g. how to update Node.js, npm, ionic cli, ionic framework, capacitor etc etc) I’ve searched quite a bit and everything I could find have missing pieces or don’t work as described.)


running npm install -g ionic actually doesn’t update your project but rather your ionic library available globally (-g) for your computer

npm install -g ionic install Ionic globally, the CLI, which allows you to run ionic cmd everywhere on your computer (like ionic start.... to create a new project)

If you want to update your project, you should go to the root of your project and there you could update like the following if you use Ionic with Angular:

  npm remove @ionic/angular --save
  npm install @ionic/angular --save

if you wish to install a specific version, current or in the past, you could do for example:

   npm install @ionic/@angular@v4.0.0-beta-7 --save

also if I may advice, always read carefully the in case other libs update would be needed when you are upgrading

I hope it’s a bit clearer, I know it’s a bit confusing at the begin

1 Like

Many many thanks for the helpful reply!!!
When a new ionic update requires updates in its dependencies, doesn’t the “npm install” adds/updates those in the process of installing ionic itself? One needs to do the update manually?
Isn’t there a way to do the ionic update and everything that needs to be updated (either updated files or updated version numbers in package.json) to be done automatically?

‘npm install’ will install what’s specified in package.json respectively what’s in package-lock.json

As far as I know there aren’t any auto-updates, except maybe the Ionic Cli (the global one, running ‘ionic serve’ you may be prompted to update it if you wish)

I think the reason behind is that you know a bit what you are using doing so, avoiding the fact that you install some unwanted dependencies

1 Like