Visual Studio Code: Difference between revisions
imported>Swaddle m Needs brackets to work |
imported>Milahu add section: Server did not start successfully |
||
Line 198: | Line 198: | ||
Don't forget to perform <code>nixos-rebuild switch</code> and reboot the system. | Don't forget to perform <code>nixos-rebuild switch</code> and reboot the system. | ||
=== Server did not start successfully === | |||
<blockquote> | |||
Server did not start successfully. Full server log at /home/user/.vscode-server/.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.log<br> | |||
<br> | |||
server log:<br> | |||
/home/user/.vscode-server/bin/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/bin/code-server: line 12: /home/user/.vscode-server/bin/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/node: No such file or directory | |||
</blockquote> | |||
"No such file or directory" means that libc is not found, see | |||
<pre> | |||
ldd ~/.vscode-server/bin/*/node | |||
</pre> | |||
try to run the node binary on the server | |||
<pre> | |||
~/.vscode-server/bin/*/node | |||
</pre> | |||
if this fails, install node version 16, and try to patch the node binary | |||
<pre> | |||
nix-env -iA nixos.nodejs-16_x | |||
</pre> | |||
<syntaxHighlight lang=bash> | |||
#! /bin/sh | |||
# fix-vscode-server-node.sh | |||
# https://github.com/microsoft/vscode-remote-release/issues/648#issuecomment-503148523 | |||
cd ~/.vscode-server/bin/* | |||
if ! ./node -e "require('process').exit(0)" | |||
then | |||
echo patching node binary $(readlink -f node) | |||
rm node | |||
ln -s $(which node) | |||
else | |||
echo node is working $(readlink -f node) | |||
fi | |||
</syntaxHighlight> |