Why does the newest Angular CLI have a corrupted packages?
I was getting the same below error when attempting to a create new project using ng new
command.
npm WARN tarball tarball data for @angular/compiler@~7.2.0 (sha512-5yb4NcLk8GuXkYf7Dcor4XkGueYp4dgihzDmMjYDUrV0NPhubKlr+SwGtLOtzgRBWJ1I2bO0S3zwa0q0OgIPOw==) seems to be corrupted. Trying one more time.
I tried many things but what did not worked and what finally worked for me I have listed below. My working node version is 12.2.0 and npm version is 6.9.0 (i.e. latest version).
What did not worked:
- Downgraded node js to other lower versions (tried many version)
- Deleted
package-lock.json
file from project and executednpm install
- Executed
npm install --registry https://registry.cnpmjs.org
instead ofnpm install
- Deleted
npm
andnpm-cache
folders fromAppData\Roaming
and then again installed node js - Deleted
node_modules
folder, executednpm update
and then executednpm install
- Executed
npm cache clean --force
and then executednpm install
- Reinstalled
@angular/cli
- Checked for any firewall / antivirus (in my case it was disabled)
- Opened node command prompt as an administrator
- Checked user permissions for the project folder
Finally what worked is:
Installed the component for which it was giving error. npm install -global @angular/compiler
I had the same problem with node 12.13.0
and npm 6.13.0
npm WARN tarball tarball data for @angular/compiler@^7.2.11 (sha512-5yb4NcLk8GuXkYf7Dcor4XkGueYp4dgihzDmMjYDUrV0NPhubKlr+SwGtLOtzgRBWJ1I2bO0S3zwa0q0OgIPOw==) seems to be corrupted. Trying one more time.
For me the problem was npm
. After upgrading npm to the newest version with npm i -g npm@latest
the problem vanished. So it seems to be a problem with npm itself and not the Angular/CLI
.
upgrade your NPM version use this command i -g npm@latest it works like magic