简体   繁体   English

如何解决 android 上 termux 应用程序中的代码服务器运行时错误?

[英]How can i solve code-server runtime error in termux app on android?

https://github.com/cdr/code-server/discussions/2157 https://github.com/cdr/code-server/discussions/2157

Screenshot1截图1

i am beginner I don't have pc so i want run vscode in android (termux app) Please some help.......我是初学者,我没有电脑,所以我想在 android(termux 应用程序)中运行 vscode 请一些帮助.......

I had download https://github.com/cdr/code-server/releases/download/v3.5.0/code-server-3.5.0-linux-arm64.tar.gz我已经下载了https://github.com/cdr/code-server/releases/download/v3.5.0/code-server-3.5.0-linux-arm64.tar.gz

With reference https://medium.com/samsung-internet-dev/developing-on-android-phones-visual-studio-code-on-dex-4c99d2e80e91参考https://medium.com/samsung-internet-dev/developing-on-android-phones-visual-studio-code-on-dex-4c99d2e80e91

To this blog Please someone suggestion...到这个博客请有人建议...

-------------------------------------------------------------------------- -------------------------------------------------- ----------------------

Thank you for great suggestion @MorrisonChang It's almost work (image below)谢谢你的好建议@MorrisonChang几乎可以工作了(下图)

Screenshot2截图2

BUT when i opened browser (image below)但是当我打开浏览器时(下图)

Screenshot3截图3

And error occurs " Error: Could not locate the bindings file. Tried: " (Description below)并且出现错误“错误:找不到绑定文件。尝试:”(下面的描述)

$ code-server
[2020-10-07T05:24:03.991Z] info  Using config file ~/.config/code-server/config.yaml
[2020-10-07T05:24:06.342Z] info  Using user-data-dir ~/.local/share/code-server
[2020-10-07T05:24:06.391Z] info  code-server 3.5.0 de41646fc402b968ca6d555fdf2da7de9554d28a
[2020-10-07T05:24:06.428Z] info  HTTP server listening on http://127.0.0.1:8080
[2020-10-07T05:24:06.429Z] info      - Using password from ~/.config/code-server/config.yaml
[2020-10-07T05:24:06.430Z] info      - To disable use `--auth none`
[2020-10-07T05:24:06.430Z] info    - Not serving HTTPS                                          Error: Could not locate the bindings file. Tried:
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Debug/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Debug/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Debug/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Release/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Release/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/default/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/compiled/14.8.0/android/arm/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/release/install-root/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/debug/install-root/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/default/install-root/spdlog.node
 → /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/lib/binding/node-v83-android-arm/spdlog.node
    at bindings (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/index.js:3:35)
    at Module._compile (internal/modules/cjs/loader.js:1251:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
    at Module.load (internal/modules/cjs/loader.js:1100:32)
    at Function.Module._load (internal/modules/cjs/loader.js:962:14)
    at Module.require (internal/modules/cjs/loader.js:1140:19)
    at Module.patchedRequire [as require] (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/diagnostic-channel/dist/src/patchRequire.js:14:46)
    at require (internal/modules/cjs/helpers.js:75:18)
    at t.load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:16:749)
    at e.load (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:13:941)
    at i (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:29:839)
    at Object.errorback (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:29:963)
    at e.triggerErrorback (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:14:306)
    at /data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:14:10
    at ReadFileContext.callback (/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/out/vs/loader.js:17:221)
    at FSReqCallback.readFileAfterOpen [as oncomplete] (fs.js:264:13) {
  tries: [
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Debug/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/Release/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Debug/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Debug/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/out/Release/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/Release/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/build/default/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/compiled/14.8.0/android/arm/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/release/install-root/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/debug/install-root/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/addon-build/default/install-root/spdlog.node',
    '/data/data/com.termux/files/home/.config/yarn/global/node_modules/code-server/lib/vscode/node_modules/spdlog/lib/binding/node-v83-android-arm/spdlog.node'
  ],
  phase: 'loading',
  moduleId: 'spdlog',
  neededBy: [ '===anonymous3===' ]
}
[2020-10-07T06:05:50.597Z] warn  vscode Unable to retrieve mac address (Error: Command failed: /sbin/ifconfig -a || /sbin/ip link
/data/data/com.termux/files/usr/bin/sh: 1: /sbin/ifconfig: Permission denied
/data/data/com.termux/files/usr/bin/sh: 1: /sbin/ip: Permission denied
)
[2020-10-07T06:06:01.430Z] warn  vscode ENOENT: no such file or directory, scandir '/data/data/com.termux/files/home/.local/share/code-server/logs'

then what should i do?那我该怎么办? please give me some suggestions请给我一些建议

I found a better solution for it.我找到了一个更好的解决方案。 I installed proot-distro, then install parrot distribution and then I used this curl -fsSL https://code-server.dev/install.sh | sh我安装了 proot-distro,然后安装了 parrot 发行版,然后我使用了这个curl -fsSL https://code-server.dev/install.sh | sh curl -fsSL https://code-server.dev/install.sh | sh to install it and now it's working properly so following steps curl -fsSL https://code-server.dev/install.sh | sh安装它,现在它可以正常工作,所以请按照以下步骤操作

apt update
apt install proot-distro nano
proot-distro install ubuntu-20.04
proot-distro login ubuntu-20.04

after doing this login into your ubuntu by typing proot-distro login ubuntu-20.04 and now copy this code and past it在通过键入proot-distro login ubuntu-20.04登录到您的 ubuntu 之后,现在复制此代码并过去它

curl -fsSL https://code-server.dev/install.sh | sh
code-server

after installation run code-server when you will run it first time it will create ~/.config/code-server/config.yaml file so now close the server and use nano ~/.config/code-server/config.yaml to set the password for code-server安装后运行code-server当你第一次运行它时它会创建~/.config/code-server/config.yaml文件所以现在关闭服务器并使用nano ~/.config/code-server/config.yaml来设置代码服务器的密码

bind-addr: 127.0.0.1:8080
auth: password
password: your-password
cert: none

VSCode is already available in Termux. VSCode 已经在 Termux 中可用。 Note that you should have a good/stable internet connection while running instructions.请注意,在运行指令时,您应该有良好/稳定的互联网连接。

Inside Termux: Termux 内部:

  1. Install NodeJS.安装 Node.js。

pkg install nodejs

  1. Install yarn安装纱线

pkg install yarn

  1. From the Termux NodeJS wiki , installTermux NodeJS wiki安装

pkg install build-essential

pkg install python

  1. Install code-server安装代码服务器

yarn global add code-server

This will take a while.这需要一段时间。 Be patient.要有耐心。

  1. Run code-server or code-server & which will run code-server in background.运行code-servercode-server &这将在后台运行 code-server。

Per the output, the password is in ~/.config/code-server/config.yaml根据输出,密码在~/.config/code-server/config.yaml

  1. Use Samsung Internet (Android app) or Chrome for Android to connect to 127.0.0.1:8080, enter password, and you should now have VSCode running on your device.使用 Samsung Internet(Android 应用程序)或 Chrome for Android 连接到 127.0.0.1:8080,输入密码,您现在应该在您的设备上运行 VSCode。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 termux 应用程序上的“npm install node-session”。 然后我得到了这个错误。 如何在 termux 上安装 node-session? - "npm install node-session" on termux app. Then i got this error. How can i install node-session on termux? 如何在我的 Android 应用程序中解决此 NullPointer 错误? - How can I solve this NullPointer error in my Android app? 如何通过另一个 android 应用程序启动 Termux? - How can you launch Termux through another android app? 在 android 手机上的 termux 中创建反应应用程序时出错 - Error creating react app in termux on android phone 我该如何解决android中的这个构建错误? - How can I solve this build error in android? 如何使用android中的imageView解决运行时错误 - how to solve RunTime error with imageView in android 当我尝试在tsutermux上安装tsudo npm时,发生错误代码enosys和err号38 - error code enosys and err number 38 occur when I try tsudo npm install on termux in android 当我尝试使用 termux 在 Android 上安装 firebase 时,我该如何解决这个问题? - How can I fix this problem I'm getting when I try to install firebase on Android using termux? 在 Termux Android 上连接到 MariaDB 服务器 - Connecting to MariaDB Server on Termux Android 我该如何解决在phonegap中下载FileTransfer错误代码3? - How can I solve download FileTransfer error code 3 in phonegap?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM