MuhammedKalkan / OpenLens

OpenLens Binary Build Repository
4.03k stars 267 forks source link

Error: The module was compiled against a different Node.js version #145

Closed wenbingzhang closed 1 year ago

wenbingzhang commented 1 year ago

version: v6.5.0 system: macos 12

Uncaught Exception: Error: The module '/Applications/OpenLens.app/Contents/Resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 106. This version of Node.js requires NODE_MODULE_VERSION 110. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install). at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822) at Module._extensions..node (node:internal/modules/cjs/loader:1226:18) at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049) at Module.load (node:internal/modules/cjs/loader:1011:32) at Module._load (node:internal/modules/cjs/loader:846:12) at f._load (node:electron/js2c/asar_bundle:2:13330) at Module.require (node:internal/modules/cjs/loader:1035:19) at require (node:internal/modules/cjs/helpers:102:18) at Object. (/Applications/OpenLens.app/Contents/Resources/app.asar/node_modules/node-pty/lib/unixTerminal.js:26:11) at Module._compile (node:internal/modules/cjs/loader:1141:14)

vitaliyf commented 1 year ago

Similar, but perhaps for a different reason (I'm on M1 Mac, so arm64):

Uncaught Exception:
Error: dlopen(/Applications/OpenLens.app/Contents/Resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node, 0x0001): tried: '/Applications/OpenLens.app/Contents/Resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Applications/OpenLens.app/Contents/Resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node' (no such file), '/Applications/OpenLens.app/Contents/Resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
at Module._extensions..node (node:internal/modules/cjs/loader:1226:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049)
at Module.load (node:internal/modules/cjs/loader:1011:32)
at Module._load (node:internal/modules/cjs/loader:846:12)
at f._load (node:electron/js2c/asar_bundle:2:13330)
at Module.require (node:internal/modules/cjs/loader:1035:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Applications/OpenLens.app/Contents/Resources/app.asar/node_modules/node-pty/lib/unixTerminal.js:26:11)
thevops commented 1 year ago

I have the same error after update

andreosipov commented 1 year ago

same error

mvillarjuan commented 1 year ago

Same error after updating to version v6.5.0 Using MacOS 13.3.1(a) AMD64

berezhinskiy commented 1 year ago

M1 Ventura 13.4 (22F66)

λ uname -a
Darwin Kernel Version 22.5.0: Mon Apr 24 20:52:24 PDT 2023; root:xnu-8796.121.2~5/RELEASE_ARM64_T6000 arm64
Screenshot 2023-05-29 at 18 05 44
lucagervasi commented 1 year ago

Same issue here.

node -v v18.16.0

lsb_release -a LSB Version: :core-4.1-amd64:core-4.1-noarch Distributor ID: Fedora Description: Fedora release 37 (Thirty Seven) Release: 37 Codename: ThirtySeven

Actually, this is the whole error so far...

./OpenLens-6.5.0.x86_64.AppImage
innerError Error: Cannot find module '../build/Debug/pty.node'
Require stack:
- /tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js
- /tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/node-pty/lib/index.js
- /tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js
- /tmp/.mount_OpenLeZrlXoJ/resources/app.asar/static/build/main.js
- 
    at Module._resolveFilename (node:internal/modules/cjs/loader:963:15)
    at n._resolveFilename (node:electron/js2c/browser_init:2:109751)
    at Module._load (node:internal/modules/cjs/loader:811:27)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js:30:15)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1196:10)
    at Module.load (node:internal/modules/cjs/loader:1011:32) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js',
    '/tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/node-pty/lib/index.js',
    '/tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/@k8slens/core/static/build/library/main.js',
    '/tmp/.mount_OpenLeZrlXoJ/resources/app.asar/static/build/main.js',
    undefined
  ]
}
A JavaScript error occurred in the main process
Uncaught Exception:
Error: The module '/tmp/.mount_OpenLeZrlXoJ/resources/app.asar.unpacked/node_modules/node-pty/build/Release/pty.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 106. This version of Node.js requires
NODE_MODULE_VERSION 110. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:1822)
    at Module._extensions..node (node:internal/modules/cjs/loader:1226:18)
    at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2049)
    at Module.load (node:internal/modules/cjs/loader:1011:32)
    at Module._load (node:internal/modules/cjs/loader:846:12)
    at f._load (node:electron/js2c/asar_bundle:2:13330)
    at Module.require (node:internal/modules/cjs/loader:1035:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/tmp/.mount_OpenLeZrlXoJ/resources/app.asar/node_modules/node-pty/lib/unixTerminal.js:26:11)
    at Module._compile (node:internal/modules/cjs/loader:1141:14)
pshakhov commented 1 year ago

Same error after upgrading to version v6.5.0 Using MacOS 13.4 i9

krokofant commented 1 year ago

Might be related to the 6.5 version. Seems similar to this issue that's been active since 6.5 alpha started.

See lensapp/lens issue 7523

mcouthon commented 1 year ago

~Anyone knows of a workaround to downgrade in the meanwhile?~

Right, just download the previous version (6.4.15) from the releases page, and install it.

cardalda commented 1 year ago

~Anyone knows of a workaround to downgrade in the meanwhile?~

Right, just download the previous version (6.4.15) from the releases page, and install it.

How can I prevent it from being upgraded again? I didn't do anything to get this broken version...

air3ijai commented 1 year ago

How can I prevent it from being upgraded again? I didn't do anything to get this broken version...

96 --> https://github.com/MuhammedKalkan/OpenLens/issues/81#issuecomment-1369754947

MuhammedKalkan commented 1 year ago

Turned off auto update for 6.5.0 for mac and linux

No errors in build process so far, that means no clue to solve as of now.

waldner commented 1 year ago

Same here with 6.5.0, using x86_64 AppImage on linux.

niorg commented 1 year ago

Same problem with the newly released 6.5.1

mcantinqc commented 1 year ago

@cardalda

How can I prevent it from being upgraded again? I didn't do anything to get this broken version...

On mac : sudo chmod -R 000 ~/Library/Application\ Support/Caches/open-lens-updater/pending

jkroepke commented 1 year ago

147 may fix this issues.

Everyone can help to validate this by checkout the pre-builds artefacts from https://github.com/MuhammedKalkan/OpenLens/actions/runs/5115183592. arm64 users are welcome to validate cross-arch builds.

cardalda commented 1 year ago

I did brew upgrade openlens on macos

image

removing the .dmg before the next attempt gave exact results...

thevops commented 1 year ago

The same for me. As a workaround try to uninstall OpenLens, download dmg package from Github, and install it manually. For me, it worked.

MuhammedKalkan commented 1 year ago

Guys maybe i should put a warning on Readme. SHA mismatch is caused by rebuild and it should be fixed at whatever repo is hosting install scripts. They keep old SHA and new rebuilds are not updated accordingly

1- Either install manually 2- Or fix that SHA at host

jkroepke commented 1 year ago

should be fixed at whatever repo is hosting install scripts.

https://github.com/Homebrew/homebrew-cask/blob/3e3a2f6b124bf3c8d19a4b3f282e8549c30c5c13/Casks/openlens.rb#L5-L6

they may not change there.

MuhammedKalkan commented 1 year ago

Just pointing out that can not be resolved here. If there is an option to skip SHA check, they can use that aswell

jkroepke commented 1 year ago

@MuhammedKalkan what did you thing about putting the Github Job ID as suffix to the Github Release to make builds distinct?

MuhammedKalkan commented 1 year ago

I would suggest to use 6 digit short commit sha. We can append that

Does homebrew trace builds by their tags ?

jkroepke commented 1 year ago

commit hash would be a bad one, since you can no identify by version number, which is newer. This is important for the updater. Job ID always count up.

Does homebrew trace builds by their tags ?

As I know, there is no automatic version bump. its more like a command like brew bump-cask-pr --version 5.6.0 openlens which opens a PR like https://github.com/Homebrew/homebrew-cask/pull/148093

MuhammedKalkan commented 1 year ago

Right , what you suggest is to add job it to release tags ? Like 5.6.0.-120 ?

jkroepke commented 1 year ago

Yeah. I would recommend to use 5.6.0-${{ github.run_id }}

github.run_id: A unique number for each workflow run within a repository. This number does not change if you re-run the workflow run.

MuhammedKalkan commented 1 year ago

yes but if an update occurs one of our files , a new workflow is registered with a new job id. Is that ok for you as well ?

jkroepke commented 1 year ago

Looking to semver, we should mark the as 5.6.0+${{ github.run_id }}. Numbers after + considered as build metadata.

Yes, then we have an always incrementing build number. The Windows and Chrome Version number has this, too. This is fine from my point of view and would result more transparency.

MuhammedKalkan commented 1 year ago

Alright , that makes sense if this will be a remedy for SHA mess

Its becoming a burden to explain and close all those issues. A new one already emerged [#148]

jkroepke commented 1 year ago

Override released artifacts is always a bad practice (it's like git push -f on main branch), from my point we should go for distinct version numbers.

MuhammedKalkan commented 1 year ago

Agreed.

biswanaths commented 1 year ago

This works for me for the different node version

cd /Applications/OpenLens.app/Contents/Resources/app.asar.unpacked/
rm -rf node_modules/node-pty/
npm install