J'ai installé VS Code sur mon ordinateur portable avec Ubuntu 16.04 LTS. J'ai essayé plusieurs méthodes d'installation avec des résultats identiques; plus récemment, j'ai suivi les "nouvelles" instructions de Cactux ici . J'ai essayé d'ouvrir l'application de deux manières sans effet.
- Lorsque j'ouvre le programme depuis 'Applications', l'icône s'affiche dans le lanceur pendant environ 15 secondes, puis disparaît. Aucune erreur n'apparaît.
- Lorsque j'ouvre un terminal et que je tape code, la commande ne fait rien et j'obtiens une nouvelle invite en moins d'une seconde.
Je me bats avec quoi essayer car je suis relativement nouveau sur Linux.
which codeyields /usr/bin/code, qui est un script bash. C'est là que je sors de ma profondeur.
Contenu du script
/usr/bin$ cat code
#!/usr/bin/env bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# If root, ensure that --user-data-dir or --file-write is specified
if [ "$(id -u)" = "0" ]; then
    for i in $@
    do
        if [[ $i == --user-data-dir || $i == --user-data-dir=* || $i == --file-write ]]; then
            CAN_LAUNCH_AS_ROOT=1
        fi
    done
    if [ -z $CAN_LAUNCH_AS_ROOT ]; then
        echo "You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument." 1>&2
        exit 1
    fi
fi
if [ ! -L $0 ]; then
    # if path is not a symlink, find relatively
    VSCODE_PATH="$(dirname $0)/.."
else
    if which readlink >/dev/null; then
        # if readlink exists, follow the symlink and find relatively
        VSCODE_PATH="$(dirname $(readlink -f $0))/.."
    else
        # else use the standard install location
        VSCODE_PATH="/usr/share/code"
    fi
fi
ELECTRON="$VSCODE_PATH/code"
CLI="$VSCODE_PATH/resources/app/out/cli.js"
ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
exit $?
Sortie de débogage (à partir de différents répertoires)
~$ bash -x code
++ id -u
+ '[' 1000 = 0 ']'
+ '[' '!' -L code ']'
++ dirname code
+ VSCODE_PATH=./..
+ ELECTRON=./../code
+ CLI=./../resources/app/out/cli.js
+ ELECTRON_RUN_AS_NODE=1
+ ./../code ./../resources/app/out/cli.js
/usr/bin/code: line 35: ./../code: No such file or directory
+ exit 127
/usr/bin$ bash -x code
++ id -u
+ '[' 1000 = 0 ']'
+ '[' '!' -L code ']'
+ which readlink
+++ readlink -f code
++ dirname /usr/share/code/bin/code
+ VSCODE_PATH=/usr/share/code/bin/..
+ ELECTRON=/usr/share/code/bin/../code
+ CLI=/usr/share/code/bin/../resources/app/out/cli.js
+ ELECTRON_RUN_AS_NODE=1
+ /usr/share/code/bin/../code /usr/share/code/bin/../resources/app/out/cli.js
+ exit 0
Contenu de PATH
~$ $PATH
bash: /home/adam/anaconda3/bin:/home/adam/anaconda3/bin:/home/adam/bin:/home/adam/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin: No such file or directory
Toute aide ou suggestion est appréciée.
sudo apt update2)sudo apt upgrade. Si vous obtenez des erreurs, corrigez-les. Ensuite, essayez d'exécuter l'apt à partir du terminal et vérifiez les erreurs.