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
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 ...
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
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 rxjs-6.6.7.tgz
Then we tried the installation again ...
npm install -g @angular/cli
... 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 ...