我正在尝试遵循“当心海盗的巢穴”教程
https://www.dartlang.org/codelabs/server/,当我尝试为PiratesApi生成客户端代码时遇到问题
当我运行命令
pub global run rpc:generate client -i lib/server/piratesapi.dart -o lib/client
我收到以下错误消息
Failed executing command 'discoveryWithImports' with error:
No constructor 'ApiParser' with matching arguments declared in class 'ApiParser'.
NoSuchMethodError: incorrect number of arguments passed to method named 'ApiParser'
Receiver: Type: class 'ApiParser'
Tried calling: ApiParser(strict: true)
Found: ApiParser()
该错误消息是什么意思?
最佳答案
尝试使用版本限制激活rpc软件包:
pub global activate rpc 0.4.1
https://www.dartlang.org/tools/pub/cmd/pub-global.html
关于dart - Dart-运行RPC生成客户端时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30934334/