angular: Can't install Angular using npm or yarn

I’m submitting a…


[x] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
[ ] Other... Please describe:

Current behavior

When running npm install while targeting any Angular v6 package in package.json I get the following errors:

npm WARN tarball tarball data for @angular/router@^6.0.2 (sha512-XqTtfs/UzT2k2MeVQG1pOP+wR1zcH8V71S6kmWIwFcfyKUgZfIm45sNsZyBZPwY2RUqwCeZYQFjPlVW8wD1PBw==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for @angular/forms@^6.0.2 (sha512-Oc234cLjTj1tx2gF/nS/TIC3Auc+LCyC8H6GYqTxXQUyZQeGHqUptvDQz3KwM9Num3EKFUr9J2yzGPnz6lZVmQ==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\compiler-cli-fb6ed8cd\src\metadata\bundler.d.ts'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\compiler-cli-fb6ed8cd\src\metadata\bundler.js'
npm WARN tarball tarball data for @angular/animations@^6.0.2 (sha512-QoNJ/L0Xgtrj1KBp8wvxhHwRt+sQ5tBihWm82UbNgN82ZNnfNzQoAqtahbZN5AY7XFmGbDX+lVt3TdO8omXhmg==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for @angular/core@^6.0.2 (sha512-+ahJofKZFyaq0kLhKUOCa3Fo4WQ4mkMmYRqwFjKgjPupzPgMh0FkBsojuP1WiBd5KTIkv7U8B4sTziUxRDrKgg==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for @angular/compiler@^6.0.2 (sha512-uKuM7dcTWwcElklT4E/tckp5fnGNUq4wDna3gZWO6fvc7FQK0SUU4l+A6C1d5YdCRgAsv6gxIrk3MxbSF9UwEw==) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for @angular/common@^6.0.2 (sha512-Yc3NnLGs1ltnDhUCOoMCQMRSkJv/sCv+jKx3uSdrvd8Y55APl2boZhZUK4WphPfWIkpvC7odpiLXAmnVgP6vcw==) seems to be corrupted. Trying one more time.
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\platform-browser-75fc8e44\esm2015\src\browser\location\browser_platform_location.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\platform-browser-75fc8e44\esm2015\src\browser\location\history.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\platform-browser-75fc8e44\esm2015\src\browser\meta.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\platform-browser-75fc8e44\esm2015\src\browser\server-transition.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\platform-browser-75fc8e44\esm2015\src\browser\testability.js'
npm WARN tar ENOENT: no such file or directory, open 'C:\Users\dude\Documents\Apps\Amazing-App\node_modules\.staging\@angular\platform-browser-75fc8e44\esm2015\src\browser\title.js'
npm WARN tarball tarball data for @angular/compiler-cli@^6.0.2 (sha512-6hupeihL+MKYbP0xvHZiaVpYVF1XAlLpI1aTVLUhpzgnR8vgXCwni9iJlr7BZFyicVgApn6l7Oh2xIvMWftYhw==) seems to be corrupted. Trying one more time.
[            ......] \ extract: WARN tarball tarball data for @angular/compiler-cli@^6.0.2 (sha512-6hupeihL+MKYbP0xvHZiaVpYVF1XAlLpI1aTVLUhpzgnR8vgXCwni9iJlr7BZFyicVgApn6l7Oh2xIvMWftYhw==) seems to be corrupted. Trying one more time.

I even tried yarn, but it didn’t help. The installation process hangs awfully long on the @angular/* packages and then exits with the following errors:

yarn install
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
error Couldn't find package "@angular/platform-server" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Expected behavior

Should install without errors.

Minimal reproduction of the problem with instructions

  1. Target Angular v6.0.2 in package.json
  2. Run npm install

What is the motivation / use case for changing the behavior?

Can’t install Angular lol.

Environment


Angular version: 6.0.2

 
For Tooling issues:
- Node version: 10.1.0  
- NPM version: 6.0.1
- yarn version: 1.6.0
- Platform: Windows 10 x64 

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 68
  • Comments: 139 (10 by maintainers)

Most upvoted comments

Folks, not saying this is a fix but attempting to install using a different registry has let me install Angular 5.

Used this from project directory npm install --registry http://registry.cnpmjs.org

Seems the issue is with https://registry.npmjs.org ?

Anyhow this was enough to let me get on with my day!

up! LOL

The whole internet broke completely. We’re doomed.

I installed yarn now and tried installing my project with it. No luck there, it gets stuck awfully long on the @angular/* packages and then exits with:

[1/4] Resolving packages...
error Couldn't find package "@angular/platform-server" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

😞

That was the scariest 2 hours 😃

So, the internet broke angular? or did angular broke the internet?

@HitomiTenshi Are you working on Windows or Linux? Asking because i think the problem originate in something else then @angular, everything was working yesterday.

“npm ERR! The operation was rejected by your operating system. npm ERR! It’s possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it.”

Have tried the following commands to resolve the issue. npm cache verify npm cache clean --force

@Suganthn1217

Hi All,

Its worked for me finally. if possible pls follow the below steps…

  1. Delete npm_modules folder where n all it’s installed

  2. C:\Windows\System32\node_modules

  3. C:\Windows\SysWOW64\node _modules

  4. C:\Users\UserPof\AppData\Roaming – npm & npm_cache

  5. Delete .nprmc file

  6. C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy – check any node related file is exist then delete.

  7. Then uninstall nodejs from control panel

  8. Delete nodeJs from your registry Steps to clean manually. https://www.iseepassword.com/blog/how-to-clean-registry-windows-10/

  9. Restart the System.

  10. Try to download node latest n install AngCli.

Thank U : )

@saadmomin Use ionic start [<name>] [<template>] --no-deps to skip running npm install automatically and then run npm install --registry http://registry.cnpmjs.org from inside the project directory afterwards.

with yarn :

yarn install v1.6.0
info No lockfile found.
[1/4] Resolving packages...
info There appears to be trouble with your network connection. Retrying...
⠠ @angular/core@^6.0.0

my network connection is OK… but it try indefinitely!

I am getting the same error, reinstalled node/NPM, cleared cached, and removed the node_modules folder, removed angular/cli, and reinstalled it. Tried Every other solution found on StackOverflow, Github, askubuntu.com but nothing seems to work, facing the issue since last two days

P.S Restarted the machine(laptop) as well.

The issue seems to be resolved, I’m closing this issue.

Yes. It looks like it might be the network layer that’s corrupting the sha sums. jovllin

Facing the same issue

I deleted packages in C:/Program Files/nodejs/node_modules then tried npm install. It worked!

@HitomiTenshi yup, the problem hat sich selbst gelöst 😄

@HitomiTenshi lol they might not thank me for this then 😀

@rabamus Thanks! Using npm install --registry http://registry.cnpmjs.org works! Cheers buddy.

You are a genius @rabamus

Same in India

@Samonia Issue also present on Mac

Someone here have this issue on Linux or Mac? When i turn of Windows real time protection the npm error change to npm ERR! Unexpected end of JSON input while parsing near ‘’

“Definition updates for Windows Defender Antivirus -KB2267602 (Definition 1.267.1445.0) Successfully installed on ‎2018-‎05-‎16”

image

Not even allowing an npm install -g @angular/cli

Not sure that it´s a NPM issue…

Hey All, After trying loads of combinations i finally found one that works.

npm 6.4.1 angular-cli 7.1.3

npm install npm@6.4.1 -g npm install -g @angular/cli@7.1.3

i’m using node v10.15.1 but not sure if that had any impact.

I deleted packages in C:/Program Files/nodejs/node_modules then tried npm install. It worked!

dont do this. it will delete all the node packages and you will have to re install everything like node, angular, ionic (tried it)

Facing the same issue

@rabamus yes I am able to access it through the web (Netherlands)

@rabamus I can access using the browser

also my project works again, thanks

jpietal@zenmonk:~$ node -v
v8.11.1
jpietal@zenmonk:~$ npm -v
5.10.0

ok

If you get npm ERR! write after end https://github.com/npm/npm/issues/19989

downgrade npm npm i npm@5 -g then use @rabamus answer

confirmed works

@jotatoledo I had the same issue. Just retry. I guess it’s being bombarded right now lol

@Prozi @jotatoledo Not sure what the hell is going on there - are you guys able to access http://registry.cnpmjs.org even through the browser?

Is it NPM issue or Angular team has uploaded some weired?

@rabamus that did it locally! on npm5.6.0

Looks like it’s an npm registry issues on private (@) repos. not angular specific. But it does seem like angular is quite a popular framework/repo, as I haven’t seen the same level of response elsewhere!

thank you @rabamus. Great workaround.

Same in Poland [*]

same from germany

@Samonia I’m using Mac and there´s no way using npm nor yarn.

It´s not an OS issue

I have posted a tweet to Angular team here --> https://twitter.com/henry2man/status/996699677310537731