【发布时间】:2019-04-23 19:40:31
【问题描述】:
我试过关注这个repo:-
但是我在编译代码时遇到以下错误:-
code = fs.readFileSync('Voting.sol').toString()
solc = require('solc')
compiledCode = solc.compile(code)
它抛出了这个错误:-
'{"errors":[{"component":"general","formattedMessage":"* Line 1, Column 1\\n Syntax error: value, object or array expected.\\n* Line 1, Column 2\\n Extra non-whitespace after JSON value.\\n","message":"* Line 1, Column 1\\n Syntax error: value, object or array expected.\\n* Line 1, Column 2\\n Extra non-whitespace after JSON value.\\n","severity":"error","type":"JSONError"}]}'
【问题讨论】:
-
你最好去 repo 那里打开一个问题。 (我假设你已经检查了打开的问题)
-
嘿@Izio,我确实打开了一个问题,但看起来开发人员几天不活跃。快速帮助将不胜感激。谢谢
-
code变量是什么?如果是一些 sol 文件,那么您是如何阅读的? -
另外,既然编译是由 Solidity 完成的,你为什么不 google google.com/….
-
编译函数采用不同的参数,具体取决于您拥有的版本。确保检查文档github.com/ethereum/solc-js#readme
标签: node.js blockchain solidity web3js