vscode web版搭建_Centos7 搭建 VSCode WEB

从git 代码搭建VSCode WEB

效果

5d7a256256f7

步骤

前置 : git ,yarn

如何准备前置(自行sudo或su - root )

安装 gityum install git

安装 yarncurl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo

yum install yarn -y

yarn --version

yarn 换国内源yarn config set registry https://registry.npm.taobao.org/

检查 yarn 源yarn config get registry

github 获取代码gitclone--depth 1 https://github.com/microsoft/vscode.git

下载源码的时候加上一句--depth 1,意思就是只下载最近一次commit的代码。

node -v 检查版本 要求版本 "Please use node >=10 and <=12."

升级 node

先卸载yum remove nodejs

升级安装

第1步 - 添加Node.js Yum存储库

首先,您需要在Node.js官方网站提供的系统中启用node.js yum存储库。您还需要开发工具来构建要在系统上安装的本机加载项。

安装最新发布:$ yum clean all && yum makecache fast

$ yum install-y gcc-c++ make

$ curl -sL https://rpm.nodesource.com/setup_12.x | sudo-E bash-

安装稳定发布:$ 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.

在系统中添加yum存储库后,让我们安装Node.js包。NPM也将与node.js一起安装。此命令还将在您的系统上安装许多其他依赖包。$ yum install -y nodejs

其他官网中要求安装的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 webyarn

报错 native-keymap: Command failed.  =>yum install libxkbfile-devel.x86_64

报错 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/*

手动缓存yarn watch

执行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

参考文档

官方文档

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值