Angular CLI: NPM WARN tarball: tarball data for …. seems to be corrupted. Trying one more time.

I got this error when running the ng new command of the CLI.

From my knowledge so far, this error could be caused by a corrupted tarball of the @angular/core package, a broken Angular CLI installation (I think that was the case for me — After forcing the Angular CLI update using the force flag) or conflict between the CLI and the globally installed TypeScript.

So in my case, after updating the CLI with ng update and the force flag like below:

I got the following error when creating a new Angular project using the CLI:

So I tried deleting and reinstalling the Angular CLI like:

That did not work,

I tried also re-installing Node and that did not work either.

So I thought I downgrade the Angular CLI version from ~8.2.4 to 8.2.2, so I uninstalled the Angular CLI again and installed the specific version like:

So that gave me a different error when running:

So I installed that version of typescript:

Uninstalled the CLI and re-installed it after the typescript installation like:

And that worked for me, for you it might be something else broken but I hope with this you will get some light.

Summary.

My assumption now is that the TypeScript I had globally was broken or conflicted with the new Angular CLI version, that is why I had to install TypeScript first and then the CLI, you can correct me on this if you know the exact cause of this kind of exception.

Edit:

Taking from another solution from the comments section by Pradi Sauzan.

If the above solution did not work for you, you can also circumvent this issue by changing your Angular CLI package manager to Yarn, albeit this might not be the best solution in case you want to stick to NPM, it does the trick if you do not have time.

  1. Have Yarn installed globally in your machine. Install Yarn
  2. Run

Now try to create a new project by running

Stargazer