NixOS does not normally install libraries in a FHS layout, which means that binaries compiled for other Linux platforms typically will not work. Visual Studio Code's Remote SSH extension transfers a NodeJS binary and a binary library built by Microsoft that must be patched to be used on NixOS.
Prior to April 2021, this could simply be done by replacing .vscode-server/bin/*/node
with nodejs-12_x
; after April 2021,
there is also a library module that is not compatible with nodejs-12_x
. Therefore, it is necessary to patch these two ELF
files.
What happens if you just replace nodejs (the pre-April solution from nixos.wiki)
The following will occur when you try to open a terminal
The terminal process failed to launch: A native exception occurred during launch (The module '.../.vscode-
server/bin/cfa2e218100323074ac1948c885448fdf4de2a7f/node_modules/node-pty/build/Release/pty.node' was compiled against a
different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 72. Please try
re-compiling or re-installing the module (for instance, using `npm rebuild` or `npm install`).).
No clue. I am not a NodeJS developer, nor do I work for Microsoft.