run-vscode-web-on-linux

# 不同版本
https://github.com/microsoft/vscode 
https://github.com/coder/code-server
https://github.com/gitpod-io/openvscode-server

 

#https://github.com/gitpod-io/openvscode-server
mkdir pty && cd pty
npm i node-pty@1.2.0-beta.10
cd node_modules/node-pty/
npx node-gyp configure
npx node-gyp build
file build/Release/pty.node

 

# 一步到位更新
apk add  alpine-sdk   gyp  python3     make     g++    linux-headers       libstdc++
apk add --no-cache gcompat libstdc++ libgcc git python3 make gcc g++ linux-headers openssl-dev
# 当前 openvscode-server-v1.109.5-linux-x64
cd  node_modules/node-pty
# 清理旧glibc编译产物
rm -rf build dist prebuilds
# 使用node-gyp重新编译musl版本 pty.node
npm run install
# 或者手动执行 node‑gyp
npx node-gyp clean
npx node-gyp configure
npx node-gyp build

file build/Release/pty.node
cd ../../
node -e “const p=require(‘node-pty’); console.log(‘node-pty loaded OK’)”
# 输出即OK , node-pty loaded OK

 

alpine pty
cat /etc/alpine-release
uname -a
uname -m
node -v
node -p "process.platform + ' ' + process.arch"
node -p "process.versions"
ldd --version
apk info | grep -E 'musl|gcompat|libc6'
#cd openvscode-server-v1.109.5-linux-x64
find node_modules -name 'pty.node' -exec file {} \;
find node_modules -name 'pty.node' -exec ldd {} \;

node -e "console.log(require.resolve('node-pty')); const pty=require('node-pty'); console.log('node-pty loaded');"

node -e "const pty=require('node-pty'); console.log(pty)"

find node_modules -name 'pty.node' -exec file {} \;

#核心,重建
apk add alpine-sdk python3 make g++ linux-headers libstdc++

#npm rebuild node-pty –build-from-source

# 诊断当前状态的命令
echo '=== OS ==='
cat /etc/alpine-release
uname -a
uname -m

echo ‘=== Node ===’
node -v
node -p “process.execPath”
node -p “process.arch”
node -p “process.versions.modules”

echo ‘=== libc ===’
ldd –version 2>&1 | head -3

echo ‘=== node-pty package ===’
node -p “require.resolve(‘node-pty/package.json’)”
node -p “require(‘node-pty/package.json’).version”

echo ‘=== pty.node ===’
find node_modules -name pty.node -exec file {} \;

echo ‘=== dependencies ===’
find node_modules -name pty.node -exec ldd {} \;

Leave a Reply

Your email address will not be published. Required fields are marked *