让前端飞

【Dart】解决无法安装webdev的问题

2024-01-14  本文已影响0人  来一斤BUG

问题描述

安装webdev时报错

Failed to build webdev:webdev:
/C:/Users/admin/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.2/lib/stream_channel.dart:9:8: Error: Error when reading '/C:/Users/admin/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.2/lib/src/close_guarantee_channel.dart': 系统找不到指定的文件。

import 'src/close_guarantee_channel.dart';
       ^
/C:/Users/admin/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.2/lib/stream_channel.dart:13:1: Error: Error when reading '/C:/Users/admin/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.2/lib/src/delegating_stream_channel.dart': 系统找不到指定的文件。

export 'src/delegating_stream_channel.dart';
^
/C:/Users/admin/AppData/Local/Pub/Cache/hosted/pub.dev/stream_channel-2.1.2/lib/stream_channel.dart:101:7: Error: Method not found: 'CloseGuaranteeChannel'.
      CloseGuaranteeChannel(stream, sink);
      ^^^^^^^^^^^^^^^^^^^^^

解决方法

  1. 命令行执行dart pub cache repair,修复缓存;
  2. 重新运行命令安装webdev: dart pub global activate webdev;
上一篇下一篇

猜你喜欢

热点阅读