DEV Community

Cover image for Angular CLI Install Fails on RxJS
bob.ts
bob.ts

Posted on

Angular CLI Install Fails on RxJS

In a recent call with a client, they were installing the Angular CLI using information from a Knowledge Training (KT) session I had done.

He used the following command ...

npm install -g @angular/cli
Enter fullscreen mode Exit fullscreen mode

It failed.

The Problem

In examining the logs, we could see that there was a FetchError occurring for https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz ...

Log file showing FetchError

He and I both copy-and-pasted the URL into our browsers. His failed while mine worked.

The assumption is that something on his local network (he was in the office, not at home) was blocking this particular download for some reason.

Failed Attempt

We tried installing the previous version of the Angular CLI. This failed, as well.

npm install -g @angular/cli@12.2.16
Enter fullscreen mode Exit fullscreen mode

My assumption is that it uses the same version of RxJS. We could have gone further back, but tried a different direction instead.

In the logs I noticed the (cache miss) while I assumed meant that npm looked to see if it had already downloaded the file.

The Solution

The next thing we tried was using the copy I retrieved to update his npm cache. I sent him the file and we executed the following command on his terminal.

npm cache add documentation

npm cache add rxjs-6.6.7.tgz
Enter fullscreen mode Exit fullscreen mode

Then we tried the installation again ...

npm install -g @angular/cli
Enter fullscreen mode Exit fullscreen mode

Terminal showing both npm commands run

... and it worked!

AN UPDATE

We saw the same issue with another npm install command and the same process worked. I transferred the file, he added it to the cache, and was able to continue the installation.

It went much faster when we knew what to do ...

Discussion (0)