【发布时间】:2020-01-23 06:09:01
【问题描述】:
我有一个基于 AngularDart 的网络项目。当我尝试webdev serve 时,我得到了这个:
[SEVERE] Support for dartdevc in build_web_compilers < 2.0.0 has been removed.
Please upgrade your dependency to:
dev_dependencies:
build_web_compilers: ">=2.0.0"
[SEVERE] Exception: dartdevc is no longer supported by this version
但是,我已经将依赖项设置为“2.0.0 及更新版本”。这是我的pubspec.yaml 文件:
name: myproject
description: My Description
environment:
sdk: '>=2.3.3 <3.0.0'
dependencies:
angular: ^5.2.0
angular_components: ^0.13.0
dev_dependencies:
angular_test: ^2.2.0
build_runner: ^1.5.0
build_test: ^0.10.3
build_web_compilers: ^2.0.0
pedantic: ^1.0.0
test: ^1.5.1
我试过pub get、pub upgrade、pub activate global webdev,甚至pub cache repair。
一般来说,我在创建 AngularDart 项目时似乎遇到了依赖问题,即使我使用来自the Dart docs 的版本也是如此。有没有一种神奇的方法可以准确地知道要使用哪个版本号?
【问题讨论】:
-
您可以尝试删除 node_modules 并尝试重新安装吗?
-
@deen - 愚蠢的问题:我该怎么做? pubspec 中没有提到 node_modules,我没有看到它在“pub deps”中被引用,并且没有该名称的目录。
-
我的错,我在 Angular 上工作过很多次我都遇到了依赖问题,所以我尝试删除 node_modules 并重新安装它。我不确定 AngularDart 是否有 node_modules。为问题道歉。
-
我认为他建议删除 .dart_tool 目录 .. node_modules 是 node.js 的东西 .. 但他的心在正确的地方 .. .dart_tool 是您的依赖项和编译工件的存储位置。 . 每当 dart/webdev 做一些奇怪的事情时,最好的做法是删除它并再次执行 pub get 和 webdev 服务
-
是的!就是这样!谢谢@BrianGorman 和迪恩。如果你们中的任何一个想写出正确的答案,请继续并要求获得 25 分。否则我过几天再写答案。
标签: angular-dart dart-pub