Incorrect Node version suddenly required by netlify plugin dependency

Hey everyone, I am dealing with strange issue where a plugin netlify-plugin-fetch-feeds breaks the build process completely out of the blue.

Facts:

  • :no_entry_sign: The build process started to fail today, Feb 1 '22.
  • :warning: Build process is triggered simply on repository change.
  • :white_check_mark: There were no breaking changes in the repository as far as I can tell. Content is managed via Forestry commits, but that was safe for years and does not seem related at all.
  • :white_check_mark: Plugin does not seem to be the culprit too β€” it’s simple in nature and was last updated in Apr '20. Worked nicely til yesterday.
  • :white_check_mark: I tried to clear the cache and deploy fresh build several times.
  • :warning: Project uses Tailwind and as such requires Node v12 to compile.
  • :warning: Both package.json and .nvmrc specifically ask for Node v12.
  • :skull_and_crossbones: I have two sites with similar setup which are affected, both started acting up at the same time.

So if I’m reading below log right, plugin relies on dependency compiled for a different Node.

Given above, how that can be? Why all of a sudden?

Is there anything I can do from where I stand?

6:38:03 PM: ❯ Loading plugins
6:38:03 PM:    - netlify-plugin-fetch-feeds@0.2.3 from netlify.toml
6:38:04 PM: ​
6:38:04 PM: ────────────────────────────────────────────────────────────────
6:38:04 PM:   Plugin "netlify-plugin-fetch-feeds" internal error            
6:38:04 PM: ────────────────────────────────────────────────────────────────
6:38:04 PM: ​
6:38:04 PM:   Error message
6:38:04 PM:   Could not import plugin:
6:38:04 PM:   Error: The module '/opt/build/repo/.netlify/plugins/node_modules/node-expat/build/Release/node_expat.node'
6:38:04 PM:   was compiled against a different Node.js version using
6:38:04 PM:   NODE_MODULE_VERSION 72. This version of Node.js requires
6:38:04 PM:   NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
6:38:04 PM:   the module (for instance, using `npm rebuild` or `npm install`).
6:38:04 PM: ​
6:38:04 PM:   Plugin details
6:38:04 PM:   Package:        netlify-plugin-fetch-feeds
6:38:04 PM:   Version:        0.2.3
6:38:04 PM:   Repository:     git+https://github.com/philhawksworth/netlify-plugin-fetch-feeds.git
6:38:04 PM:   npm link:       https://www.npmjs.com/package/netlify-plugin-fetch-feeds
6:38:04 PM:   Report issues:  https://github.com/philhawksworth/netlify-plugin-fetch-feeds/issues
6:38:04 PM: ​
6:38:04 PM:   Error location
6:38:04 PM:   While loading "netlify-plugin-fetch-feeds" from netlify.toml
6:38:04 PM:       at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
6:38:04 PM:       at Module.load (node:internal/modules/cjs/loader:981:32)
6:38:04 PM:       at Function.Module._load (node:internal/modules/cjs/loader:822:12)
6:38:04 PM:       at Module.require (node:internal/modules/cjs/loader:1005:19)
6:38:04 PM:       at require (node:internal/modules/cjs/helpers:102:18)
6:38:04 PM:       at bindings (/opt/build/repo/.netlify/plugins/node_modules/bindings/bindings.js:112:48)
6:38:04 PM:       at Object.<anonymous> (/opt/build/repo/.netlify/plugins/node_modules/node-expat/lib/node-expat.js:4:34)
6:38:04 PM:       at Module._compile (node:internal/modules/cjs/loader:1101:14)
6:38:04 PM:       at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
6:38:04 PM:       at Module.load (node:internal/modules/cjs/loader:981:32)
6:38:04 PM: ​
6:38:04 PM:   Error properties
6:38:04 PM:   { code: 'ERR_DLOPEN_FAILED' }
6:38:04 PM: ​
6:38:04 PM:   Resolved config
6:38:04 PM:   build:
6:38:04 PM:     command: bundle exec jekyll pagemaster recipes && npm run build
6:38:04 PM:     commandOrigin: config
6:38:04 PM:     publish: /opt/build/repo/_site
6:38:04 PM:     publishOrigin: config
6:38:04 PM:   plugins:
6:38:04 PM:     - inputs: {}
6:38:04 PM:       origin: config
6:38:04 PM:       package: netlify-plugin-fetch-feeds

Hey there, @jakubheglas :wave:

Thanks so much for such a well written post! Sorry to hear you are encountering this obstacle.

We can definitely look into this further for you. Can you share your project repo as well as your full deploy log? If your project repo isn’t public, could you share you netlify.toml file?

1 Like

Thanks for getting at me Hillary!

Please find log and netlify.toml below. Please note that the API route we use to retrieve content has been redacted.

:page_facing_up: netlify.toml

[build]
  command = "bundle exec jekyll pagemaster recipes && npm run build"
  publish = "_site/"

[[plugins]]
  package = "netlify-plugin-fetch-feeds"

  [plugins.inputs]
    dataDir = "_data"

    [[plugins.inputs.feeds]]
      name = "recipes"
      url = "https://api.redacted-url.com/data.json"
      ttl = 3600

:page_facing_up: Full deployment log:

9:38:28 AM: Build ready to start
9:38:33 AM: build-image version: 122b31996ccaffd45d820a452d6227f8312110cc (focal)
9:38:33 AM: build-image tag: v4.5.3
9:38:33 AM: buildbot version: 94cf4881e10a7b2d529971a176d6ede22bcaeb38
9:38:33 AM: Building without cache
9:38:33 AM: Starting to prepare the repo for build
9:38:34 AM: No cached dependencies found. Cloning fresh repo
9:38:34 AM: git clone git@bitbucket.org:userbrain/tdk-web
9:38:36 AM: Preparing Git Reference refs/heads/master
9:38:37 AM: Parsing package.json dependencies
9:38:37 AM: Starting build script
9:38:37 AM: Installing dependencies
9:38:37 AM: Python version set to 2.7
9:38:38 AM: Attempting node version 'v12.18.0' from .nvmrc
9:38:38 AM: Downloading and installing node v12.18.0...
9:38:38 AM: Downloading https://nodejs.org/dist/v12.18.0/node-v12.18.0-linux-x64.tar.xz...
9:38:39 AM: Computing checksum with sha256sum
9:38:39 AM: Checksums matched!
9:38:41 AM: Now using node v12.18.0 (npm v6.14.4)
9:38:41 AM: Started restoring cached build plugins
9:38:41 AM: Finished restoring cached build plugins
9:38:42 AM: Attempting ruby version 2.7.2, read from .ruby-version file
9:38:43 AM: Using ruby version 2.7.2
9:38:43 AM: Using bundler version 2.2.22 from Gemfile.lock
9:38:44 AM: Successfully installed bundler-2.2.22
9:38:44 AM: 1 gem installed
9:38:44 AM: Using PHP version 8.0
9:38:44 AM: Started restoring cached ruby gems
9:38:44 AM: Finished restoring cached ruby gems
9:38:44 AM: Installing gem bundle
9:38:45 AM: [DEPRECATED] The `--path` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local path '/opt/build/cache/bundle'`, and stop using this flag
9:38:45 AM: [DEPRECATED] The --binstubs option will be removed in favor of `bundle binstubs --all`
9:38:46 AM: Fetching gem metadata from https://rubygems.org/
9:38:47 AM: Fetching gem metadata from https://rubygems.org/.........
9:38:48 AM: Using bundler 2.2.22
9:38:48 AM: Fetching colorator 1.1.0
9:38:48 AM: Fetching concurrent-ruby 1.1.9
9:38:48 AM: Fetching eventmachine 1.2.7
9:38:48 AM: Fetching http_parser.rb 0.8.0
9:38:48 AM: Fetching forwardable-extended 2.6.0
9:38:48 AM: Fetching public_suffix 4.0.6
9:38:48 AM: Fetching ffi 1.15.5
9:38:48 AM: Fetching rb-fsevent 0.11.0
9:38:48 AM: Installing forwardable-extended 2.6.0
9:38:48 AM: Installing colorator 1.1.0
9:38:48 AM: Installing public_suffix 4.0.6
9:38:48 AM: Installing eventmachine 1.2.7 with native extensions
9:38:48 AM: Installing rb-fsevent 0.11.0
9:38:48 AM: Installing http_parser.rb 0.8.0 with native extensions
9:38:48 AM: Installing concurrent-ruby 1.1.9
9:38:48 AM: Fetching rexml 3.2.5
9:38:48 AM: Fetching liquid 4.0.3
9:38:48 AM: Installing rexml 3.2.5
9:38:48 AM: Fetching mercenary 0.4.0
9:38:48 AM: Installing liquid 4.0.3
9:38:48 AM: Installing ffi 1.15.5 with native extensions
9:38:48 AM: Fetching rouge 3.27.0
9:38:48 AM: Installing mercenary 0.4.0
9:38:48 AM: Installing rouge 3.27.0
9:39:21 AM: Fetching unicode-display_width 1.8.0
9:39:21 AM: Fetching safe_yaml 1.0.5
9:39:21 AM: Fetching rainbow 3.1.1
9:39:21 AM: Installing unicode-display_width 1.8.0
9:39:21 AM: Installing safe_yaml 1.0.5
9:39:21 AM: Installing rainbow 3.1.1
9:39:22 AM: Fetching addressable 2.8.0
9:39:22 AM: Fetching pathutil 0.16.2
9:39:22 AM: Fetching kramdown 2.3.1
9:39:22 AM: Fetching i18n 1.9.1
9:39:22 AM: Fetching terminal-table 2.0.0
9:39:22 AM: Fetching sassc 2.4.0
9:39:22 AM: Fetching rb-inotify 0.10.1
9:39:22 AM: Fetching em-websocket 0.5.3
9:39:23 AM: Installing rb-inotify 0.10.1
9:39:23 AM: Installing pathutil 0.16.2
9:39:23 AM: Installing i18n 1.9.1
9:39:23 AM: Installing addressable 2.8.0
9:39:23 AM: Installing em-websocket 0.5.3
9:39:23 AM: Installing kramdown 2.3.1
9:39:23 AM: Installing terminal-table 2.0.0
9:39:23 AM: Fetching listen 3.7.1
9:39:23 AM: Installing sassc 2.4.0 with native extensions
9:39:23 AM: Installing listen 3.7.1
9:39:23 AM: Fetching jekyll-watch 2.2.1
9:39:23 AM: Installing jekyll-watch 2.2.1
9:43:26 AM: Fetching kramdown-parser-gfm 1.1.0
9:43:26 AM: Fetching jekyll-sass-converter 2.1.0
9:43:26 AM: Installing kramdown-parser-gfm 1.1.0
9:43:26 AM: Installing jekyll-sass-converter 2.1.0
9:43:26 AM: Fetching jekyll 4.2.1
9:43:26 AM: Installing jekyll 4.2.1
9:43:26 AM: Using pagemaster 2.1.2 from source at `_plugins`
9:43:26 AM: Fetching jekyll-paginate-v2 3.0.0
9:43:26 AM: Fetching jekyll-sitemap 1.4.0
9:43:26 AM: Fetching jekyll-seo-tag 2.7.1
9:43:26 AM: Installing jekyll-seo-tag 2.7.1
9:43:26 AM: Installing jekyll-paginate-v2 3.0.0
9:43:26 AM: Installing jekyll-sitemap 1.4.0
9:43:26 AM: Bundle complete! 5 Gemfile dependencies, 33 gems now installed.
9:43:26 AM: Bundled gems are installed into `/opt/build/cache/bundle`
9:43:26 AM: Gem bundle installed
9:43:26 AM: Started restoring cached node modules
9:43:26 AM: Finished restoring cached node modules
9:43:26 AM: Installing NPM modules using NPM version 6.14.4
9:43:49 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/tailwindcss/node_modules/fsevents):
9:43:49 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:43:49 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
9:43:49 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:43:49 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/browser-sync/node_modules/fsevents):
9:43:49 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
9:43:49 AM: added 919 packages from 518 contributors and audited 992 packages in 21.858s
9:43:50 AM: 56 packages are looking for funding
9:43:50 AM:   run `npm fund` for details
9:43:50 AM: found 48 vulnerabilities (37 moderate, 11 high)
9:43:50 AM:   run `npm audit fix` to fix them, or `npm audit` for details
9:43:50 AM: NPM modules installed
9:43:50 AM: Started restoring cached go cache
9:43:50 AM: Finished restoring cached go cache
9:43:50 AM: go version go1.16.5 linux/amd64
9:43:50 AM: go version go1.16.5 linux/amd64
9:43:50 AM: Installing missing commands
9:43:50 AM: Verify run directory
9:43:52 AM: ​
9:43:52 AM: ────────────────────────────────────────────────────────────────
9:43:52 AM:   Netlify Build                                                 
9:43:52 AM: ────────────────────────────────────────────────────────────────
9:43:52 AM: ​
9:43:52 AM: ❯ Version
9:43:52 AM:   @netlify/build 26.2.2
9:43:52 AM: ​
9:43:52 AM: ❯ Flags
9:43:52 AM:   baseRelDir: true
9:43:52 AM:   buildId: 61fa43046c4950d60215d5e5
9:43:52 AM:   deployId: 61fa43046c4950d60215d5e7
9:43:52 AM: ​
9:43:52 AM: ❯ Current directory
9:43:52 AM:   /opt/build/repo
9:43:52 AM: ​
9:43:52 AM: ❯ Config file
9:43:52 AM:   /opt/build/repo/netlify.toml
9:43:52 AM: ​
9:43:52 AM: ❯ Context
9:43:52 AM:   production
9:43:52 AM: ​
9:43:52 AM: ❯ Installing plugins
9:43:52 AM:    - netlify-plugin-fetch-feeds@0.2.3
9:44:04 AM: ​
9:44:04 AM: ❯ Loading plugins
9:44:04 AM:    - netlify-plugin-fetch-feeds@0.2.3 from netlify.toml
9:44:06 AM: ​
9:44:06 AM: ────────────────────────────────────────────────────────────────
9:44:06 AM:   Plugin "netlify-plugin-fetch-feeds" internal error            
9:44:06 AM: ────────────────────────────────────────────────────────────────
9:44:06 AM: ​
9:44:06 AM:   Error message
9:44:06 AM:   Could not import plugin:
9:44:06 AM:   Error: The module '/opt/build/repo/.netlify/plugins/node_modules/node-expat/build/Release/node_expat.node'
9:44:06 AM:   was compiled against a different Node.js version using
9:44:06 AM:   NODE_MODULE_VERSION 72. This version of Node.js requires
9:44:06 AM:   NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
9:44:06 AM:   the module (for instance, using `npm rebuild` or `npm install`).
9:44:06 AM: ​
9:44:06 AM:   Plugin details
9:44:06 AM:   Package:        netlify-plugin-fetch-feeds
9:44:06 AM:   Version:        0.2.3
9:44:06 AM:   Repository:     git+https://github.com/philhawksworth/netlify-plugin-fetch-feeds.git
9:44:06 AM:   npm link:       https://www.npmjs.com/package/netlify-plugin-fetch-feeds
9:44:06 AM:   Report issues:  https://github.com/philhawksworth/netlify-plugin-fetch-feeds/issues
9:44:06 AM: ​
9:44:06 AM:   Error location
9:44:06 AM:   While loading "netlify-plugin-fetch-feeds" from netlify.toml
9:44:06 AM:       at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)
9:44:06 AM:       at Module.load (node:internal/modules/cjs/loader:981:32)
9:44:06 AM:       at Function.Module._load (node:internal/modules/cjs/loader:822:12)
9:44:06 AM:       at Module.require (node:internal/modules/cjs/loader:1005:19)
9:44:06 AM:       at require (node:internal/modules/cjs/helpers:102:18)
9:44:06 AM:       at bindings (/opt/build/repo/.netlify/plugins/node_modules/bindings/bindings.js:112:48)
9:44:06 AM:       at Object.<anonymous> (/opt/build/repo/.netlify/plugins/node_modules/node-expat/lib/node-expat.js:4:34)
9:44:06 AM:       at Module._compile (node:internal/modules/cjs/loader:1101:14)
9:44:06 AM:       at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
9:44:06 AM:       at Module.load (node:internal/modules/cjs/loader:981:32)
9:44:06 AM: ​
9:44:06 AM:   Error properties
9:44:06 AM:   { code: 'ERR_DLOPEN_FAILED' }
9:44:06 AM: ​
9:44:06 AM:   Resolved config
9:44:06 AM:   build:
9:44:06 AM:     command: bundle exec jekyll pagemaster recipes && npm run build
9:44:06 AM:     commandOrigin: config
9:44:06 AM:     publish: /opt/build/repo/_site
9:44:06 AM:     publishOrigin: config
9:44:06 AM:   plugins:
9:44:06 AM:     - inputs: {}
9:44:06 AM:       origin: config
9:44:06 AM:       package: netlify-plugin-fetch-feeds
9:44:06 AM: Caching artifacts
9:44:06 AM: Started saving ruby gems
9:44:06 AM: Finished saving ruby gems
9:44:06 AM: Started saving node modules
9:44:07 AM: Finished saving node modules
9:44:07 AM: Started saving build plugins
9:44:07 AM: Finished saving build plugins
9:44:07 AM: Started saving pip cache
9:44:07 AM: Finished saving pip cache
9:44:07 AM: Started saving emacs cask dependencies
9:44:07 AM: Finished saving emacs cask dependencies
9:44:07 AM: Started saving maven dependencies
9:44:07 AM: Finished saving maven dependencies
9:44:07 AM: Started saving boot dependencies
9:44:07 AM: Finished saving boot dependencies
9:44:07 AM: Started saving rust rustup cache
9:44:07 AM: Finished saving rust rustup cache
9:44:07 AM: Started saving go dependencies
9:44:07 AM: Finished saving go dependencies
9:44:10 AM: Build failed due to a plugin error: Build script returned non-zero exit code: 3
9:44:10 AM: Creating deploy upload records
9:44:10 AM: Failing build: Failed to build site
9:44:10 AM: Failed during stage 'building site': Build script returned non-zero exit code: 3
9:44:10 AM: Finished processing build request in 5m36.885158568s

Hey @jakubheglas,

The build plugins use a different Node Version and this is non-configurable. Recently, we started using Node 16 for plugins ONLY if the site uses Node version less than 12.20.0. Could you try updating the site’s Node version to see if this works for you?

2 Likes

Hi @jakubheglas,

Another possible approach could also be to install the plugin to your site’s package.json. The plugin will be installed alongside your site’s dependencies and then use your preferred Node.js version (12) instead of Node 16. This might solve your above problem. Please let us know if this works!

1 Like

That’s good to know, thanks! Unfortunately, explicitly setting Node to 12.20 didn’t do much for us. Anyway, are these breaking changes announced somewhere? Would be great to keep ourselves on top of these!

:tada: However @ehmicky 's suggestion worked wonders, cheers!

3 Likes

We’re happy your problem is solved @jakubheglas!

This was announced in the following post.

We use the β€œUpdates” tag for this type of announcements (which can be subscribed to). We also really strive to minimize the amount of breaking changes. However, there are a few cases where it’s very difficult to avoid, and this was unfortunately one of them.

We’re sorry this resulted in some hiccups, but at least it works again now, which is great! :tada:

1 Like

No worries, thanks for spot-on response, really appreciated!

I’ll make sure to check the Updates posts first, that’s very helpful indeed.

2 Likes