Incompatible version of node in latest GitHub ubuntu 20.04 image
Closed this issue · 8 comments
In https://github.com/actions/virtual-environments/pull/4395/files, NodeJS 16 has been added to the ubuntu image. I think this is the reason we are hitting that error in our CI although we are using the GitHub actions to use NodeJS 14. Is there a workaround? Or do we need to wait for iterative/cml#825?
failing due to an update of NodeJS in the ubuntu image that is incompatible with CML action (to publish the benchmark image).
Error: The module '/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/build/Release/magic.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 93. This version of Node.js requires NODE_MODULE_VERSION 83.
-- jupyterlab/jupyterlab#11606
93 corresponds to node 16. We could also bump to that version in the benchmarks CI workflow?
The trouble is the cml installation that does not apparently use the specified version of node JS but rather one it finds on the os. As GitHub recently added nodejs 16 to the Ubuntu 20.04 image, that breaks CML. This is not related to our code. I opened an issue upstream. No answer yet
-- jupyterlab/jupyterlab#11607 (comment)
Other relevant info to the above issues:
jobs:
test:
runs-on: ubuntu-20.04
steps:
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: iterative/setup-cml@v1
- env:
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cml-publish ./benchmark-results/lab-benchmark.png --md >> ./benchmark-results/lab-benchmark.md
Note that setup-cml
itself just uses npm
found on $PATH
to install things:
Line 37 in a7b00a8
Unsure of how best to go about fixing this.
- Seems to be a bug in
actions/setup-node
itself? - Unrelated (though would work) how about dropping EoL NodeJSv14 and upgrading to the active v16 as suggested in jupyterlab/jupyterlab#11607 (comment)?
- Also probably unrelated but noticed we have
Line 14 in a7b00a8
'node16'
Original error message
internal/modules/cjs/loader.js:1144
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: The module '/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/build/Release/magic.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/lib/index.js:1:13)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
code: 'ERR_DLOPEN_FAILED'
}
Simplified reproducible example
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: iterative/setup-cml@v1
- run: cml-publish /dev/null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Run actions/checkout@v2
Syncing repository: ···
Getting Git version info
Deleting the contents of '/home/runner/work/···/···'
Initializing the repository
Disabling automatic garbage collection
Setting up auth
Fetching the repository
Determining the checkout info
Checking out the ref
/usr/bin/git log -1 --format='%H'
'···'
Run actions/setup-node@v2
with:
node-version: 14.x
always-auth: false
check-latest: false
token: ***
Found in cache @ /opt/hostedtoolcache/node/14.18.1/x64
Run iterative/setup-cml@v1
Uninstalling previous CML
Installing CML version latest
Run cml-publish /dev/null
internal/modules/cjs/loader.js:1144
return process.dlopen(module, path.toNamespacedPath(filename));
^
Error: The module '/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/build/Release/magic.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 83. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/usr/local/lib/node_modules/@dvcorg/cml/node_modules/mmmagic/lib/index.js:1:13)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12) {
code: 'ERR_DLOPEN_FAILED'
}
Minimal reproducible example
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- run: |
set -x
sudo npm --version
npm --version
sudo node --version
node --version
Run actions/setup-node@v2
Found in cache @ /opt/hostedtoolcache/node/14.18.1/x64
Run set -x
+ sudo npm --version
8.1.0
+ npm --version
6.14.15
+ sudo node --version
v16.13.0
+ node --version
v14.18.1
Minimal working example
on: workflow_dispatch
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14.x'
- uses: iterative/setup-cml@v1
with:
sudo: false
- run: cml-publish /dev/null
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Apparently, setup-node@v2
install the requested node
version at the user level, not at the system level.
On the other hand, setup-cml@v1
uses sudo
by default for the installation process, causing mmmagic
to build against the default node
version, as opposed to the specified one.
Subsequent workflow steps will try to run cml
with the specified node
version, but resorting to the native modules built for the default version.
@fcollonval should be fixed now!
Thanks a lot @0x2b3bfa0 and @casperdcl for fixing this.