Truffle
Truffle Metacoin 無法從任何來源找到 ConvertLib.sol 的工件
我剛剛從 Truffle http://truffleframework.com/boxes/metacoin拆箱了 Metacoin 範例
當我在 VS Code 中對其執行 truffle 測試時,出現以下錯誤:
1) TestMetacoin "before all" hook: prepare suite: Error: Could not find artifacts for /D/TruffleTest/contracts/ConvertLib.sol from any sources at Resolver.require (C:\Users\MyPuter\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-resolver\index.js:37:1) at TestResolver.require (C:\Users\MyPuter\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-core\lib\testing\testresolver.js:17:1) at TestResolver.require (C:\Users\MyPuter\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-core\lib\testing\testresolver.js:17:1) at C:\Users\MyPuter\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-core\lib\testing\soliditytest.js:141:1 at Array.forEach (<anonymous>) at C:\Users\MyPuter\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-core\lib\testing\soliditytest.js:140:1 at C:\Users\MyPuter\AppData\Roaming\npm\node_modules\truffle\build\webpack:\~\truffle-deployer\src\deferredchain.js:20:1 at <anonymous> at process._tickCallback (internal/process/next_tick.js:188:7)
我對下載的範例沒有做任何事情,只是從https://medium.com/@wslyvh/get-started-with-ethereum-solidity-on-windows-1672e9953a1一步一步進行操作
任何想法為什麼它在測試中的所有部分都失敗了?松露編譯工作正常。
我還直接從下載連結中提取了範例文件夾,並在該文件夾上從 powershell 執行了松露測試,並得到了完全相同的問題。我有點失落。
感謝這篇文章,我剛剛發現:“Truffle test”在 petshop 教程中失敗
我發現這個問題是由 truffle 4.1.5 中引入的一個錯誤引起的。在我將 npm 包回滾到 4.1.4 後,一切都按預期工作。