Cs50 VScode ide 仅在恢复模式下运行

问题描述 投票:0回答:2

每当我尝试打开 cs50 vscode 工作区时,它都会首先发出以下通知:

由于容器错误,此代码空间当前正在恢复模式下运行。查看创建日志,根据需要更新您的 devcontainer 配置,然后运行“重建容器”命令重试。

然后预装的工具都不起作用(sqlite3、python 等)

这是创建日志的最后几行:

2022-04-21 01:59:29.258Z: Stop (3 ms): Run in container: cat /root/.vscode-remote/data/Machine/settings.json
2022-04-21 01:59:29.271Z: $ ls /root/.vscode-remote/bin/*/node | head -n 1
2022-04-21 01:59:29.284Z: 
2022-04-21 01:59:29.299Z: ls: cannot access '/root/.vscode-remote/bin/*/node': No such file or directory
2022-04-21 01:59:29.312Z: Stop (21 ms): Run in container: ls /root/.vscode-remote/bin/*/node | head -n 1
2022-04-21 01:59:29.330Z: userEnvProbe: none (default)
2022-04-21 01:59:29.343Z: $55.88679008Z' > '/root/.vscode-remote/data/Machine/.onCreateCommandMarker'
2022-04-21 01:59:29.358Z: 
2022-04-21 01:59:29.371Z: 
2022-04-21 01:59:29.385Z: Exit code 1
2022-04-21 01:59:29.400Z: && echo '2022-04-20T15:04:55.88679008Z' > '/root/.vscode-remote/data/Machine/.onCreateCommandMarker'
2022-04-21 01:59:29.414Z: $55.88679008Z' > '/root/.vscode-remote/data/Machine/.updateContentCommandMarker'
2022-04-21 01:59:29.428Z: 
2022-04-21 01:59:29.446Z: 
2022-04-21 01:59:29.461Z: Exit code 1
2022-04-21 01:59:29.474Z: && echo '2022-04-20T15:04:55.88679008Z' > '/root/.vscode-remote/data/Machine/.updateContentCommandMarker'
2022-04-21 01:59:29.487Z: $55.88679008Z' > '/root/.vscode-remote/data/Machine/.postCreateCommandMarker'
2022-04-21 01:59:29.503Z: Stop (455 ms): Resolving Remote
2022-04-21 01:59:29.517Z: 
2022-04-21 01:59:29.531Z: 
2022-04-21 01:59:29.545Z: Exit code 1
2022-04-21 01:59:29.578Z: && echo '2022-04-20T15:04:55.88679008Z' > '/root/.vscode-remote/data/Machine/.postCreateCommandMarker'
2022-04-21 01:59:29.610Z: $23.284538754Z' > '/root/.vscode-remote/data/Machine/.postStartCommandMarker'
2022-04-21 01:59:29.629Z: 
2022-04-21 01:59:29.643Z: 
2022-04-21 01:59:29.659Z: && echo '2022-04-21T01:59:23.284538754Z' > '/root/.vscode-remote/data/Machine/.postStartCommandMarker'

这是创建日志其余部分的 Pastebin:https://pastebin.com/PnWaBv7W

有什么办法可以解决这个问题吗?

visual-studio-code ide cs50
2个回答
6
投票

我运行了

touch /workspaces/GITHUB_USERID/.devcontainer.json
,其中
GITHUB_USERID
是我自己的 GitHub 用户 ID。

然后我点击“立即重建”来重建容器。

CS50 学生可以通过访问 www.github.com/code50 找到他们的代码。


0
投票

对于spr shb的解决方案不起作用的人,请遵循CS50团队本身的故障排除指南

具体:

运行此命令(将其复制粘贴到您的 Codespace 终端):

curl https://cs50.dev/devcontainer.json > /workspaces/$RepositoryName/.devcontainer.json

完成后,按 F1 > 输入

Codespaces: Rebuild Container
> 按
Full Rebuild

© www.soinside.com 2019 - 2024. All rights reserved.