NodeJS regularly fails to install after 10min

Hello,
We’re facing issue installing node on CircleCI machines (ubuntu or macos) regularly using CircleCI orb circleci/node@5 with this step :

- node/install:
      node-version: "18"

See error above

nvm is already installed. Skipping nvm install.
Downloading and installing node v18.17.1...
Downloading https://nodejs.org/dist/v18.17.1/node-v18.17.1-darwin-arm64.tar.xz...
##########                                                                14.8%curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

Binary download from https://nodejs.org/dist/v18.17.1/node-v18.17.1-darwin-arm64.tar.xz failed, trying source.
grep: /Users/distiller/.nvm/.cache/bin/node-v18.17.1-darwin-arm64/node-v18.17.1-darwin-arm64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 4 CPU core(s)
Running with 3 threads to speed up the build
Clang v3.5+ detected! CC or CXX not specified, will use Clang as C/C++ compiler!
Downloading https://nodejs.org/dist/v18.17.1/node-v18.17.1.tar.xz...
#######################################                                   54.4%curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

Binary download from https://nodejs.org/dist/v18.17.1/node-v18.17.1.tar.xz failed, trying source.
grep: /Users/distiller/.nvm/.cache/src/node-v18.17.1/node-v18.17.1.tar.xz: No such file or directory
Provided file to checksum does not exist.

Exited with code exit status 1

It is very frustrating (and expensive !) to see a job fail after 10 min because of this.

Is this a known issue ? Is there anything we can do to prevent this?

Thank you

5 Likes

Can you provide more details about which Machine Images you are using?

The ORB uses the version of curl that comes with the machine image and that is what is throwing the error, but as it is all done within the ORB code there is no easy way to make changes and there are reports that the error comes from the fact that curl was upgraded to default to HTTP/2 when the URL indicates an HTTPS session which may cause issues is certain environments due to things like load balancers.

To get around the issue the best option would be to script the install directly rather than being limited by the exposed features of the ORB. Install instructions can be found here

I placed a link to this message change on the ORB’s github issues page

Thank you for you reply.
The problem affects different types of machines like ubuntu-2004:202008-01, ubuntu-2204:2023.04.2, macos.medium xcode:14.2.0 or macos.m1.medium.gen1 xcode:14.3.1.
Weird to have to do this on our own instead of using the tools given by CircleCI :thinking:

We are having the same issue on macos.x86.medium.gen2 xcode: 13.4.1

Regularly it also takes an hour to install if it doesn’t crash.
Edit: figured out that this is because if the initial download fails, it will try to download and build from source - which takes forever.

Will try to install it in another way and see if that helps.

we’re having the same issue on macos.x86.medium.gen2 with xcode 14.2.0 :melting_face:
@marco2216 could you please share here if you figured out how to solve this issue :pray:

For now we are installing with homebrew instead, it doesn’t have the option to install a specific minor version though if you need that.
e.g.

HOMEBREW_NO_AUTO_UPDATE=1 brew install node@18

Is there anyone from Circle CI to give us some help?

We randomly face this error as well on both the macos.m1.medium.gen1 and android/android-machine executors

The root cause appears to be the fact that Node.js binaries CDN use a tiered system where only the latest LTS version is readily available.

So when Node.js did bump to 18.18.0 after a few days 18.17.1 binaries were demoted and now are served from the lower tier of the CDN with worse availability.

Does CircleCI already cache Node.js binaries on its own? It appears to be a way to save quite a bit of external traffic on your end.

We also face this issue, and at least once a week it causes multiple builds to either fail or take a very long time. We are using the official orb, so it would be great if this at least offered some caching solution for binaries.

The output after 15 minutes:
/usr/local/lib
├── corepack@0.14.2
=> If you wish to uninstall them at a later point (or re-install them under your
=> nvm Nodes), you can remove them from the system Node as follows:

 $ nvm use system
 $ npm uninstall -g a_module

=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR=“$HOME/.nvm”
[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm
Downloading and installing node v18.15.0…
Downloading [link removed]
############### 21.1%curl: (92) HTTP/2 stream 0 was not closed cleanly: INTERNAL_ERROR (err 2)

Binary download from [link removed] failed, trying source.
grep: /home/circleci/.nvm/.cache/bin/node-v18.15.0-linux-x64/node-v18.15.0-linux-x64.tar.xz: No such file or directory
Provided file to checksum does not exist.
Binary download failed, trying source.
Detected that you have 36 CPU core(s)
Running with 35 threads to speed up the build
Downloading [link removed]
############################################## 65.1%