I installed the latest Node and Angular on Windows 10
npm install npm@latest -g
npm install -g @angular/cli@latest
But when I try to start a project ng new new-project
I get the following error
npm WARN tarball tarball data for @angular/compiler@^6.1.0 (sha512-TY6axB1c7VvYXf+ebFDq3Ej+edgii3CDxew8HnyTFAWeDF2Gh8io1vTYwtdyDka6U53ASaheM1HpiUjzvYH0jQ==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\admin\Desktop\...\node_modules\.staging\@angular\common-6be83a81\locales\si.js'
...
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\admin\AppData\Roaming\npm-cache\_logs\2018-10-08T01_01_48_404Z-debug.log
Package install failed, see above.
I tried to uninstall Node.js and Angular CLI completely and then reinstall again
npm install npm@latest -g
npm install -g @angular/cli@latest
But still the same error ..... So I googled this issue. It seems like some people had it too, but then it magically disappeared for some people.
How to fix this?
The Angular latest Official stable version is Angular v13. 2.5, which is released on 2nd March 2022.
To solve the error "ng: command not found", install the angular cli package globally by running npm install -g @angular/cli@latest and restart your terminal. If the command fails, run it with sudo and make sure the correct PATH is set in your system's environment variable.
The npm ERR! code 1 error usually occurs when you run the npm install command. This cause of this error is that one of the dependencies you define in your package. json file fails to be installed properly on your computer.
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:
package-lock.json
file from project and executed npm install
npm install --registry https://registry.cnpmjs.org
instead of npm install
npm
and npm-cache
folders from AppData\Roaming
and then again installed node jsnode_modules
folder, executed npm update
and then executed npm install
npm cache clean --force
and then executed npm install
@angular/cli
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With