Ubuntu虚拟机在node命令行中编译.sol文件报错:{“errors“:[{“component“:“general“,“formattedMessage“...(已解决)

Ubuntu虚拟机在node命令行下编译.sol文件报错

'{"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"}]}'

参考教程:https://blog.csdn.net/ye_zen/article/details/106588850


第一种方法将

var sourceCode = fs.readFileSync('Voting.sol').toString(

你可能感兴趣的:(疑难杂症,区块链,虚拟机,node)