Ubuntu安装VSCode-Online
官方文档:https://github.com/Microsoft/vscode/wiki/How-to-Contribute
安装软件
git
nodejs
版本需
>=10.x
,<=12.x
,apt
安装默认版本为81
2
3
4
5sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install npm -g
sudo npm install -g n
sudo n 12.16.1yarn
官方安装文档:
https://classic.yarnpkg.com/en/docs/install#debian-stable1
2
3curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update && sudo apt install yarnpython
必须是2.7,不支持Python3
make
pkg-config
libx11-dev
libxkbfile-dev
libsecret-1-dev
下载vscode源码
1 | git clone https://github.com/microsoft/vscode.git |
安装cnpm
国内使用npm太慢,简易使用cnpm。(修改npm源依旧会下载失败)
编译vscode
1 | cd vscode |
会遇到各种错误
下载失败/解压失败
此时,会显示下载地址,下载到哪里,解压到哪里
手动下载到指定目录,并加压到指定地点,文件夹不存在时需创建编译错误
找到编译错误的组件,使用
npm
卸载后,cnpm
安装
常见错误组件有vscode-ripgrep
、node-gyp
、electron
卡在electron
进入
node_moduls/electron/
在
package.js
中找到下载地址,并下载,一般为_resolved
创建
path.txt
,写入electron
(Windows版本是electron.exe)将安装包解压到
dist
文件夹下执行
1
node install.js
重新运行编译
watch
1 | yarn watch |
会在watch-client
执行较长时间
当Finished compilation with 0 errors
时,可以直接退出
运行
1 | yarn web --host IP --port 端口号 |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 AlMirai!