在"/home/vagrant/.pub-cache/hosted/pub.dartlang.org/protobuf-0.5.3"中找不到名为 "pubspec.yaml" 的文件



我正试图从Vagrant VM内部构建一个Dart项目。该项目实际上是使用IntelliJ从我的主机上创建的,但我希望无论谁使用Vagrant虚拟机,都能够构建该项目(通常情况下,使用Dart工具对Dart项目做一切可能的事情),这是我设置Vagrant VM进行开发的主要原因。

因此(在Vagrant环境中通常如此),在我的客户机中,路径/vagrant包含与Vagrantfile所在主机上的文件相同(且同步)的文件。

我的Dart项目是在主机上的文件夹dart-angular-client下创建的,该文件夹与Vagrantfile处于同一级别。我可以从dart-angular-client和IntelliJ内部的主机构建项目,但我的想法是能够从Vagrant机器内部构建项目。

因此,当我尝试在我的访客Vagrant VM的/vagrant/dart-angular-client下键入pub build时,我获得了以下错误

Could not find a file named "pubspec.yaml" in "/home/vagrant/.pub-cache/hosted/pub.dartlang.org/protobuf-0.5.3"

其中CCD_ 8基本上是访客Vagrant VM的主目录。我尝试从客户机内部手动全局安装Dart包,正如人们所料,该包确实安装在/home/vagrant/.pub-cache下,因为(据我所知)全局安装/激活的Dart包都放在该文件夹下(甚至在我的主机中)。

如何从Vagrant VM内部构建我的项目?


编辑

在执行pub get之后(正如Günter Zöchbauer所建议的),当我现在运行命令pub build时,我获得了

vagrant@vagrant-ubuntu-trusty-64:/vagrant/dart-angular-client$ pub build
Loading source assets... 
Loading angular2/transform/codegen and dart_to_js_script_rewriter transformers... 
Loading angular2 transformers... (6.5s)Dumping native stack trace for thread c36
[0x000000000091a708] dart::WeakTable::SetValue(dart::RawObject*, long)
[0x000000000091a708] dart::WeakTable::SetValue(dart::RawObject*, long)
[0x00000000008c3e20] dart::Scavenger::ProcessWeakReferences()
[0x00000000008c464f] dart::Scavenger::Scavenge(bool)
[0x00000000006f0298] dart::Heap::CollectNewSpaceGarbage(dart::Thread*, dart::Heap::ApiCallbacks, dart::Heap::GCReason)
[0x00000000006f0cc8] dart::Heap::AllocateNew(long)
[0x000000000078baf8] dart::Object::Allocate(long, long, dart::Heap::Space)
[0x00000000007aadc3] dart::TypedData::New(long, long, dart::Heap::Space)
[0x0000000000aeaf69] dart::BootstrapNatives::DN_TypedData_Uint8Array_new(_Dart_NativeArguments*)
[0x00007f0cb907e579] Unknown symbol
[0x00007f0cb737e97d] Unknown symbol
[0x00007f0cab554524] Unknown symbol
[0x00007f0cab5534ee] Unknown symbol
[0x00007f0cab552588] Unknown symbol
[0x00007f0cab551e6d] Unknown symbol
[0x00007f0cb601dfba] Unknown symbol
[0x00007f0cab551a53] Unknown symbol
[0x00007f0cab54f4e9] Unknown symbol
[0x00007f0cab50fde3] Unknown symbol
[0x00007f0caeb01d4d] Unknown symbol
[0x00007f0cb6c78cb0] Unknown symbol
[0x00007f0cb52c198f] Unknown symbol
[0x00007f0cb6c7a97e] Unknown symbol
[0x00007f0cab56cf92] Unknown symbol
[0x00007f0cab58165a] Unknown symbol
[0x00007f0caeaee66d] Unknown symbol
[0x00007f0cab581ff7] Unknown symbol
[0x00007f0cab51bba1] Unknown symbol
[0x00007f0caeb01d4d] Unknown symbol
[0x00007f0cb6c78cb0] Unknown symbol
[0x00007f0cb52c198f] Unknown symbol
[0x00007f0cb6c7a97e] Unknown symbol
[0x00007f0cab56cf92] Unknown symbol
[0x00007f0cab58165a] Unknown symbol
[0x00007f0caeaee66d] Unknown symbol
[0x00007f0cab581ff7] Unknown symbol
[0x00007f0cab52c77b] Unknown symbol
[0x00007f0caeb01d4d] Unknown symbol
[0x00007f0cb6c78cb0] Unknown symbol
[0x00007f0cb52c198f] Unknown symbol
[0x00007f0cb6c7a97e] Unknown symbol
[0x00007f0cab56cf92] Unknown symbol
[0x00007f0cab58165a] Unknown symbol
[0x00007f0caeaee66d] Unknown symbol
[0x00007f0cab5389f0] Unknown symbol
[0x00007f0cb6c80a6d] Unknown symbol
[0x00007f0cb6c8048c] Unknown symbol
[0x00007f0cb30900bd] Unknown symbol
[0x00007f0caeaebbe4] Unknown symbol
[0x00007f0caeafbd71] Unknown symbol
[0x00007f0caeafe6b8] Unknown symbol
[0x00007f0cb6c80a6d] Unknown symbol
[0x00007f0cb6c8048c] Unknown symbol
[0x00007f0cb30900bd] Unknown symbol
[0x00007f0cb6c915c2] Unknown symbol
[0x00007f0cb6c80ae9] Unknown symbol
[0x00007f0cb6c8048c] Unknown symbol
[0x00007f0cb30900bd] Unknown symbol
[0x00007f0cb6c915c2] Unknown symbol
[0x00007f0cab582b12] Unknown symbol
[0x00007f0cb651de80] Unknown symbol
[0x00007f0caeaf2520] Unknown symbol
[0x00007f0cab58756e] Unknown symbol
[0x00007f0cb907e836] Unknown symbol
[0x000000000064e2f0] dart::DartEntry::InvokeFunction(dart::Function const&, dart::Array const&, dart::Array const&)
[0x00000000006521bd] dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)
[0x000000000074f4e8] dart::IsolateMessageHandler::HandleMessage(dart::Message*)
[0x000000000077124a] dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)
[0x00000000007715e1] dart::MessageHandlerTask::Run()
-- End of DumpStackTrace

这似乎有点严重。我不确定是什么导致了这个问题(pub、Vagrant等),但这似乎是C++代码。这看起来像是堆栈损坏。。。这发生在从主机构建项目之后,但(据我所知)每当我们试图重建Dart项目时,build(如果存在)都会被替换。

编辑2

我再次尝试了reloadprovision虚拟机,然后我在里面ssh,我再次尝试buildDart项目,结果类似:

Loading source assets... 
Loading angular2/transform/codegen and dart_to_js_script_rewriter transformers... 
Loading angular2 transformers... (7.3s)runtime/vm/scavenger.cc: 399: error: Out of memory.
Dumping native stack trace for thread 9f9
(7.4s)  [0x000000000087b7ee] dart::Profiler::DumpStackTrace()
[0x000000000087b7ee] dart::Profiler::DumpStackTrace()
[0x00000000005c8f5d] dart::DynamicAssertionHelper::Fail(char const*, ...)
[0x00000000008c353d] dart::Scavenger::Prologue(dart::Isolate*, bool)
[0x00000000008c43e6] dart::Scavenger::Scavenge(bool)
[0x00000000006f0298] dart::Heap::CollectNewSpaceGarbage(dart::Thread*, dart::Heap::ApiCallbacks, dart::Heap::GCReason)
[0x00000000006f0cc8] dart::Heap::AllocateNew(long)
[0x000000000078baf8] dart::Object::Allocate(long, long, dart::Heap::Space)
[0x000000000078bca8] Unknown symbol
[0x00000000006520cf] dart::DartLibraryCalls::HandleMessage(dart::Object const&, dart::Instance const&)
[0x000000000074f4e8] dart::IsolateMessageHandler::HandleMessage(dart::Message*)
[0x000000000077124a] dart::MessageHandler::HandleMessages(dart::MonitorLocker*, bool, bool)
[0x00000000007715e1] dart::MessageHandlerTask::Run()
-- End of DumpStackTrace
Aborted (core dumped)

编辑3

甚至还没有摧毁和vagrant up虚拟机,它似乎已经改变了一些东西,因为我获得了:

vagrant@vagrant-ubuntu-trusty-64:/vagrant/dart-angular-client$ pub build
Loading source assets... 
Loading angular2/transform/codegen and dart_to_js_script_rewriter transformers... 
Loading angular2 transformers... (11.8s)runtime/vm/scavenger.cc: 399: error: Out of memory.
Dumping native stack trace for thread 2646
[0x000000000087b7ee] dart::Profiler::DumpStackTrace()
(17.0s)  [0x000000000087b7ee] dart::Profiler::DumpStackTrace()
[0x00000000005c8f5d] dart::DynamicAssertionHelper::Fail(char const*, ...)
[0x00000000008c353d] dart::Scavenger::Prologue(dart::Isolate*, bool)
[0x00000000008c43e6] dart::Scavenger::Scavenge(bool)
[0x00000000006f0298] dart::Heap::CollectNewSpaceGarbage(dart::Thread*, dart::Heap::ApiCallbacks, dart::Heap::GCReason)
[0x00000000006f09b9] dart::Heap::AllocateOld(long, dart::HeapPage::PageType)
(17.6s)  [0x000000000078ba67] dart::Object::Allocate(long, long, dart::Heap::Space)
[0x000000000078bca8] Unknown symbol
[0x00000000007d2c2b] dart::HashMap<dart::UnorderedHashTable<dart::CompressedTokenTraits, 1l> >::InsertOrGetValue(dart::Object const&, dart::Object const&) const
[0x00000000007d31e8] dart::CompressedTokenStreamData::AddToken(dart::Scanner::TokenDescriptor const&)
Killed
  • 确保pub getpub build之前运行

  • 确保虚拟机有足够的RAM(另请参阅如何增加RAM并在Vagrant中设置仅限主机的网络?)

最新更新