2

I was trying to compile a .sol file using solcjs --standardjson inputConfig.json command, the compilation had thrown error. But when I try with Solidity compiler, the compilation was success.

Can you please instruct me how to compile with solcjs --standardjson command?

My inputConfig.json content is:

{"language": "Solidity",
"sources":
{
   "testEth.sol":
{
"urls":[
    "E:\Solidity\testEth\testEth\testEth.sol"
     ]
  }
},
"settings":
{
   "optimizer": {
      "enabled": true
},
    "evmVersion": "byzantium",
    "outputSelection": {
     "*": {
       "*": [
           "abi", "evm.bytecode"
          ]
       }
     }
  }
}

Following texts are the error message had thrown:

**fs.js:193 let mode = stats[1]; ^

TypeError: Cannot read property '1' of undefined at isFileType (fs.js:193:19) at Object.readFileSync (fs.js:380:16) at Object. (C:\Users\john\AppData\Roaming\npm\node_modules\solc\solcjs:60:18) at Module._compile (internal/modules/cjs/loader.js:1063:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12) at internal/main/run_main_module.js:17:47**

1 Answer 1

0

I have pretty much the same problem, and have raised it as an issue on the GitHub repository of solc-js.

If your main goal is to deploy the contract on Ethereum and play around with it, then as a temporary alternative, you can instead compile your contract using the --abi and --bin options, because that's all you really need in order to deploy and interact with the contract.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.