官方版本下載
- https://github.com/coder/code-server/releases?q=4.0.0&expanded=true
- 使用大于版本3.8.0,因?yàn)榕f版本有插件市場(chǎng)不能訪問的情況
- 版本太高需要更新環(huán)境依賴
拉取安裝包
[]# wget "https://github.com/coder/code-server/releases/download/v4.0.0/code-server-4.0.0-linux-amd64.tar.gz"
[]# tar -xvzf code-server-4.0.0-linux-amd64.tar.gz
配置賬號(hào)密碼
export PASSWORD="lijiacai" # 環(huán)境變量中設(shè)置密碼
[]# vim ~/.config/code-server/config.yaml
bind-addr: 127.0.0.1:8081
auth: password
password: 6705e7bca8485030e4633c0b
cert: false # https開關(guān)
后臺(tái)啟動(dòng)運(yùn)行
./code-server-4.0.0-linux-amd64/bin/code-server --port 8081 --host 0.0.0.0 ./readme/
備注
- 出現(xiàn)報(bào)錯(cuò)
Failed to set 'pythonPath'. Error: Unable to write to Folder Settings because no resource is provided.
修復(fù)不能切換環(huán)境問題(請(qǐng)?jiān)陧?xiàng)目中添加)
[]# mkdir .vscode
[]# cat .vscode/settings.json
{
"python.pythonPath": "/usr/bin/python3.8"
}
- 啟動(dòng)問題
Unable to connect to VS Code server: Error in request.
Error: connect ENOENT /run/user/1000/vscode-ipc-5cc265b0-6bec-4e0e-99c7-8fc48bccd7c4.sock
at PipeConnectWrap.afterConnect [as oncomplete] (node:net:1161:16) {
errno: -2,
code: 'ENOENT',
syscall: 'connect',
address: '/run/user/1000/vscode-ipc-5cc265b0-6bec-4e0e-99c7-8fc48bccd7c4.sock'
}
- 終端執(zhí)行
[]$ VSCODE_IPC_HOOK_CLI=$( lsof | grep $UID/vscode-ipc | awk '{print $(NF-1)}' | head -n 1 )
- 效果
設(shè)置瀏覽器安全問題
谷歌瀏覽器
地址欄輸入:chrome://flags/#unsafely-treat-insecure-origin-as-secure文章來源:http://www.zghlxwxcb.cn/news/detail-825853.html
edge瀏覽器
地址欄輸入:edge://flags/#unsafely-treat-insecure-origin-as-secure文章來源地址http://www.zghlxwxcb.cn/news/detail-825853.html
到了這里,關(guān)于【使用vscode在線web搭建開發(fā)環(huán)境--code-server搭建】的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!