從git 代碼搭建VSCode WEB
效果
步驟
前置 : git ,yarn
如何準(zhǔn)備前置(自行sudo或su - root )
安裝 git
yum install git
安裝 yarn
curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo
yum install yarn -y
yarn --version
yarn 換國內(nèi)源
yarn config set registry https://registry.npm.taobao.org/?
檢查 yarn 源
yarn config get registry
github 獲取代碼
gitclone--depth 1 https://github.com/microsoft/vscode.git
下載源碼的時(shí)候加上一句--depth 1匪燕,意思就是只下載最近一次commit的代碼覆旭。
node -v 檢查版本 要求版本 "Please use node >=10 and <=12."
升級(jí) node
先卸載
? yum remove nodejs
升級(jí)安裝
第1步 - 添加Node.js Yum存儲(chǔ)庫
首先,您需要在Node.js官方網(wǎng)站提供的系統(tǒng)中啟用node.js yum存儲(chǔ)庫侨拦。您還需要開發(fā)工具來構(gòu)建要在系統(tǒng)上安裝的本機(jī)加載項(xiàng)檩坚。
安裝最新發(fā)布:
$ yum clean all && yum makecache fast
$ yum install-y gcc-c++ make
$ curl -sL https://rpm.nodesource.com/setup_12.x | sudo-E bash-
安裝穩(wěn)定發(fā)布:
$ yum clean all && yum makecache fast
$ yum install-y gcc-c++ make
$ curl -sL https://rpm.nodesource.com/setup_10.x | sudo-E bash-
第2步 - 在CentOS上安裝Node.js.
在系統(tǒng)中添加yum存儲(chǔ)庫后疙赠,讓我們安裝Node.js包交掏。NPM也將與node.js一起安裝。此命令還將在您的系統(tǒng)上安裝許多其他依賴包刨肃。
$ yum install -y nodejs
其他官網(wǎng)中要求安裝的
make
yum install pkgconfig
GCCor another compile toolchain
native-keymapneedslibx11-devandlibxkbfile-dev.
yum install libX11-devel.x86_64 libxkbfile-devel.x86_64
keytarneedslibsecret-1-dev.
yum install libsecret-devel.
正式安裝 vscode web
yarn
報(bào)錯(cuò) native-keymap: Command failed.? =>
yum install libxkbfile-devel.x86_64
報(bào)錯(cuò) error An unexpected error occurred: "https://registry.yarnpkg.com/typescript/-/typescript-1.8.10.tgz: unexpected end of file".
cd node_modules/
wget https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz
tar -xzf typescript-3.8.3.tgz
安裝 回滾
yarn cache clean
$ rm -rf ~/vscode/node_modules/*
手動(dòng)緩存
yarn watch
執(zhí)行web版
yarn web
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
$ export NODE_OPTIONS="--max-old-space-size=4096"
開放8080端口
iptables -I INPUT -p tcp --dport 8080 -j ACCEPT
參考文檔
http://www.reibang.com/p/4fe6de38622f
https://blog.csdn.net/easylife206/article/details/104132396
https://www.cnblogs.com/barrywu/p/12058501.html
官方文檔