当我try 在Ubuntu服务器上运行用Dart构建的API时,我得到了以下信息:
root@veyilserver:~/veyilapi# dart run
Building package executable... (17.7s)
Compilation did not produce any result. Expected file at /root/veyilapi/.dart_tool/pub/bin/veyilapi/tmpCNPJMW/veyilapi.dart-3.3.4.snapshot.incremental.temp
Built veyilapi:veyilapi.
Cannot rename file to '/root/veyilapi/.dart_tool/pub/bin/veyilapi/veyilapi.dart-3.3.4.snapshot', path = '/root/veyilapi/.dart_tool/pub/bin/veyilapi/tmpCNPJMW/veyilapi.dart-3.3.4.snapshot.incremental.temp' (OS Error: No such file or directory, errno = 2)
PathNotFoundException: Cannot rename file to '/root/veyilapi/.dart_tool/pub/bin/veyilapi/veyilapi.dart-3.3.4.snapshot', path = '/root/veyilapi/.dart_tool/pub/bin/veyilapi/tmpCNPJMW/veyilapi.dart-3.3.4.snapshot.incremental.temp' (OS Error: No such file or directory, errno = 2)
直到我昨天重新启动服务器,一切都运行得很完美.现在,它完全坏了.我try 卸载和重新安装Dart SDK,也try 使用早期版本(3.3.0和3.0.0),但无法克服这个版本.
有人能帮忙解决问题吗?
抱歉,但我不确定这是语言还是Dart虚拟机的问题.
以下是有关我正在使用的服务器和Dart版本的更多信息:
Dart version and tooling diagnostic info (dart info
)
General info
Dart 3.3.4 (stable) (None) on "linux_x64"
on linux / Linux 6.5.0-28-generic #29-Ubuntu SMP PREEMPT_DYNAMIC Thu Mar 28 23:46:48 UTC 2024
locale is C.UTF-8
Process info
未找到dart 进程.
操作系统
Ubuntu 23.10 x64
Pubspec.yaml
name: veyilapi
description: A simple server setup
version: 1.0.0
environment:
sdk: ">=3.0.0"
dependencies:
args: ^2.5.0
shelf: ^1.4.1
shelf_router: ^1.1.4
http: ^1.2.1
dev_dependencies:
lints: ^3.0.0
test: ^1.25.4
此外,当我try 运行dart compile
时,出现了以下错误:
root@veyilserver:~/veyilapi# dart compile exe bin/veyilapi.dart
Error: AOT compilation failed
Generating AOT kernel dill failed!
我已经做了什么?
- 确保所有依赖项都是最新的.
- 搜索
.dart_tools
,发现空的. - 初始化
.dart_tools
并运行dart pub get
. - 在互联网上搜索,发现一个包含类似文本dart-lang/sdk#55453的问题,这导致我找到了dart-lang/pub存储库中的这一特定行,该行记录了特定的错误行.
- 已提交新一期dart-lang/sdk#55639
- 从服务器卸载Dart SDK并重新安装.
- 已将Dart SDK降级为旧版本并判断其是否正常工作.
- (May 5, 06:43) Tried running
dart pub cache clean
-