注册 登录
n/website · 8 个月前 · 1548 次浏览
u/cs9u钻石钻石会员
n/websiteu/cs9u 钻石会员 · 8 个月前

https://rustix.me/ 的容器建一个网站不行哇?

https://rustix.me/ 的容器建一个网站不行哇? 有点玩不来。

4
52
登录后参与讨论。
最佳答案楼主采纳 · 回答者获得 20 声望
linying233338 个月前2 赞同

cs9u: 运行后提示 const { spawn } = require(‘child_process’); SyntaxError: Invalid or unexpected token at internalCompileFunction (node:internal/vm:128:18) at wrapSafe (node:internal/modules/cjs/loader:1279:20) at Module._compile (node:internal/m…

52 条回复

你在看其中一组对话 往上一层 查看全部回复
  1. linying23333 😇 钻石 2 YEARS 7 个月前

    你的问题, 这明显是windows抛出的错误.
    windows不能用单引号抗内部转义, windows只支持双引号包裹命令.
    我用的git bash当然可以用单引号

    不会用给我去用控制台, 有对接网页控制台. 那个也可以敲命令进去

    0
  2. taoye 青铜 7 个月前

    大佬教训的是。。
    我看到佬说的只支持静态编译的文件,我是在一个 linux 服务器上编译好,然后上传到 rustix 了。可行。。。(感谢大佬指点)

    0
  3. linying23333 😇 钻石 2 YEARS 7 个月前 已编辑

    taoye:
    我看到佬说的只支持静态编译的文件,我是在一个 linux 服务器上编译好,然后上传到 rustix 了。可行。。。

    你能解决无特权问题怎么玩都行, 本质那里面是给你拉的个docker容器.

    就是没特权很多事情干不了, 要不然都不叫你静态编译了


    新:

    最近发现有个叫做conda的免特权包管理器,看来不用全部都自己静态编译了

    export install_dir="$(pwd)"
    curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
    bash Miniconda3-latest-Linux-x86_64.sh -b -p "$install_dir/conda"
    export PATH="$install_dir/conda/bin:$PATH"
    echo "export PATH=\"$install_dir/conda/bin:$PATH\"" >> $HOME/.bashrc
    source "$install_dir/conda/bin/activate"
    # 现在你可以安装东西了
    conda install gcc make git ttyd -y -c conda-forge
    nohup ttyd -p $SERVER_PORT -W env TERM=xterm-256color bash -i 2>&1 >/dev/null & </dev/null
    
    1
  4. taoye 青铜 7 个月前
    这条回复已被版主删除
  5. taoye 青铜 7 个月前

    懂了!感谢佬指点!

    0