我正在尝试运行Truffle Petshop示例:http://truffleframework.com/tutorials/pet-shop
但是Migrations.sol无法编译或写入工件失败。我无法确定哪个错误。输出表明Adoption.sol编译,然后项目模板中提供的Migrations.sol不编译。显然,项目模板是正确的,那么什么会导致错误?
我在Windows 7.0上运行具有提升权限的PowerShell。
提前致谢
输出:
PS C:\Users\username\Documents\Code\BlockChainCode\pet-shop-box-master> truffle compile
Compiling .\contracts\Adoption.sol...
Compiling .\contracts\Migrations.sol...
5
truffle : 5
At line:1 char:1
+ truffle compile
+ ~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (5:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\wrapper.js:48
throw e;
^
abort(5) at Error
at jsStackTrace (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:1:19718)
at stackTrace (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:1:19901)
at abort (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:19:15285)
at Array.dXb (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:11:585101)
at Array.tX (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:8:557453)
at Array.eea (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:6:495332)
at Object.wOb [as dynCall_ii] (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:11:540050)
at invoke_ii (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:1:1275129)
at Array.ixa (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:7:494308)
at Object.bVb [as dynCall_viii] (C:\Users\username\AppData\Roaming\npm\node_modules\truffle\node_modules\solc\soljson.js:11:577232)
答案 0 :(得分:0)
我升级了Truffle版本,它解决了这个问题。