Atom 1.63.1 Native Module Compatibility During Environment Migration
0 reputation · 19 Oct 2022, 00:30 UTC
0 reputation · 19 Oct 2022, 00:30 UTC
Atom version 1.63.1 is pinned to Electron 13.x, which utilizes a specific Application Binary Interface (ABI) for native Node.js modules. When migrating existing development environments to modern operating systems or updating the underlying Node.js runtime to version 18 or higher, packages relying on node-gyp for C++ addons often encounter build failures.
Because the Atom Package Manager (apm) and the official repository are archived, there are no upstream updates to resolve these ABI mismatches. This creates a conflict for teams attempting to maintain legacy custom packages or language servers that require native compilation without modifying the core editor source code.
Can native modules be successfully rebuilt for Atom 1.63.1 on Node 18+ environments? Is there a documented method to bypass the archived apm metadata API to force-install local versions of these native packages?
34775 reputation · 19 Oct 2022, 05:12 UTC
No. Native addons cannot be built against the host Node 18+ runtime and loaded in Atom 1.63.1. Atom 1.63.1 ships Electron 13.1.7, ABI 93. A native module must be compiled against the Electron 13.x headers and ABI, not against the system Node version. Rebuilding is possible with the correct target flags, but success depends on toolchain and glibc compatibility on the host. There is no official, documented way to bypass the archived apm metadata API. A practical workaround is to install a native package from a local path so apm does not need to resolve it from the archived registry.
--target and --dist-url. The Electron headers are fetched from https://atom.io/download/atom-shell for this version.Likely: Rebuilding with electron-rebuild or node-gyp rebuild --target=13.1.7 --arch=x64 --dist-url=https://atom.io/download/atom-shell produces a .node binary that Atom 1.63.1 can load without modifying core source.
Uncertain / requires verification: Host glibc compatibility. Atom core was built against glibc ~2.27. Rebuilding on a host with a newer glibc is generally acceptable for forward compatibility, but a newer toolchain can introduce build warnings and a binary that will not run on older glibc hosts. The exact Node 18+ host toolchain is not a blocker for the build itself, because the target is Electron, not Node. Container isolation is feasible to guarantee a legacy build environment, but it adds IPC and filesystem complexity for language servers.
npm install --save-dev electron-rebuild
npx electron-rebuild --target=13.1.7 --dist-url=https://atom.io/download/atom-shell
Or directly:
node-gyp rebuild --target=13.1.7 --arch=x64 --dist-url=https://atom.io/download/atom-shell
node_modules of the package.apm install --dev --no-optional --no-atom-dependencies
With a package.json dependency pointing to a local path, apm will use the local copy instead of querying the archived registry.apm list --installed to confirm the package is listed locally.Error: Module did not self-register or ABI mismatch errors.ldd --version. Host glibc must be >= the one used to build Atom, typically 2.27.Missing diagnostic detail that changes recommendation: Host OS and architecture, and the specific native module name and its build scripts. Knowing glibc version and whether the module uses prebuilt binaries vs node-gyp determines if a container with node:14-bullseye is required.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.