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

Thabo Ambrose
2 min readSep 4, 2019

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:

ng update @angular/cli @angular/core --force

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

npm WARN tarball tarball data for @angular/core@~8.2.4 (sha512-8FSdkUSb5S4+K2w49                                                                                                                                                                                               iLzrQF/jzcmoRnOogFZQ8CctiXQHSVHHF8AjpoFpFVUAI6/77UVL8CehlyBSKF5EE1Z8A==) seems t                                                                                                                                                                                               o be corrupted. Trying one more time.

So I tried deleting and reinstalling the Angular CLI like:

npm uninstall -g @angular/cli
npm cache clean --force
npm install -g @angular/cli

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:

npm install -g @angular/cli@8.2.2

So that gave me a different error when running:

ng new someProject
...
...
...
npm WARN tarball tarball data for typescript@~3.5.3 (sha512-ACzBtm/PhXBDId6a6sDJfroT2pOWt/oOnk4/dElG5G33ZL776N3Y6/6bKZJBFpd+b05F3Ct9qDjMeJmRWtE2/g==) seems to be corrupted. Trying one more time.

So I installed that version of typescript:

npm install -g typescript@~3.5.3

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

npm install -g @angular/cli@8.2.2

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
ng config -g cli.packageManager yarn

Now try to create a new project by running

ng new project_name

--

--