Last active
May 7, 2021 18:50
-
-
Save swdunlop/3fed235d6c6e5a58fc2f39291f5936f9 to your computer and use it in GitHub Desktop.
Revisions
-
swdunlop revised this gist
May 7, 2021 . 1 changed file with 9 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,16 @@ Prior to April 2021, this could simply be done by replacing `.vscode-server/bin/ 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](https://nixos.wiki/wiki/Vscode)) 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`).). ``` ## Why does this happen? No clue. I am not a NodeJS developer, nor do I work for Microsoft. -
swdunlop revised this gist
May 7, 2021 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,5 +7,8 @@ there is also a library module that is not compatible with `nodejs-12_x`. There files. ``` The terminal process failed to launch: A native exception occurred during launch (The module '/home/scott/.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`).). ``` -
swdunlop revised this gist
May 7, 2021 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,8 @@ 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. ``` The terminal process failed to launch: A native exception occurred during launch (The module '/home/scott/.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`).). ``` -
swdunlop created this gist
May 7, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ 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. This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/usr/bin/env bash interpreter=$(nix eval --raw '((import <nixpkgs> { }).stdenv.glibc)')/lib/ld-linux-x86-64.so.2 libstdcxx=$(nix eval --raw '((import <nixpkgs> { }).stdenv.cc.cc.lib)')/lib/libstdc++.so.6 for dir in ~/.vscode-server/bin/*; do cd $dir patchelf \ --set-interpreter $interpreter \ --replace-needed libstdc++.so.6 $libstdcxx \ node patchelf \ --replace-needed libstdc++.so.6 $libstdcxx \ node_modules/node-pty/build/Release/pty.node done