My Netlify site is on the Focal build image. It’s been around a few years, and was recently upgraded from the legacy Trusty build image. So there are cached memories of old dependency versions, like Ruby and Python, etc. (The solution of re-linking my repository as suggested here, Build fails with Focal image due to unwanted old Ruby - #4 by hillary, didn’t work, but that’s for another topic).
The Focal docs say Node v16 is the default version.
I’ve got a
.node-version file that declares v16 as the dependency.
Yet my Netlify build installs Node v16 rather than just using it, like it does so for Python, Ruby, and PHP (see log snippet below).
Why is this happening? How to cut the install time down by relying on the default v16?
11:17:31 AM: Starting build script 11:17:31 AM: Installing dependencies 11:17:31 AM: Python version set to 2.7 11:17:31 AM: Attempting node version '16' from .node-version 11:17:31 AM: Downloading and installing node v16.10.0... 11:17:32 AM: Downloading https://nodejs.org/dist/v16.10.0/node-v16.10.0-linux-x64.tar.xz... 11:17:32 AM: Computing checksum with sha256sum 11:17:32 AM: Checksums matched! 11:17:35 AM: Now using node v16.10.0 (npm v7.24.0) 11:17:35 AM: Started restoring cached build plugins 11:17:35 AM: Finished restoring cached build plugins 11:17:35 AM: Attempting ruby version 2.7.2, read from environment 11:17:37 AM: Using ruby version 2.7.2 11:17:37 AM: Using PHP version 8.0 11:17:37 AM: Started restoring cached node modules