4

when I run

web3.eth.getCompilers()

I found that Solidity is not my geth compiler. I try to set it by

admin.setSolc("/usr/local/bin/solc") An error that

Error:solc:exit status 1
      at web3.js:3119:20
      at web3.js:6023:15
      at web3.js:4995:36
      at <anonymous>:1:2

so I try to use solcjs and it worked. But when i compile with contract,the same ERROR happend.Someone know what's wrong?thx very much.LOG

3
  • 1
    what's which solc returns? – Badr Bellaj Dec 28 '16 at 10:33
  • 1
    and /usr/local/bin/solc --version ?? – Badr Bellaj Dec 28 '16 at 10:33
  • 1
    you can try this command : admin.setSolc("/usr/bin/solc") – user5240 Jan 7 '17 at 7:32
2

I think your first error is due to invalid path to solc. You can check if it is really at /usr/local/bin/solc:

$ whereis solc
solc: /usr/bin/solc

You get second error because geth (at least versions <=1.5.6) does not support solcjs as Solidity compiler (see here).

geth tries to run solc with arguments which are not supported by solcjs (see here).

2
  • If you had multiple copies of solc on your machine, whereis solc would return all of them. Using which solc will return just the one that would be executed in the current environment. (So the first occurrence that appears in $PATH.) – Richard Horrocks Jan 7 '17 at 10:35
  • thx. solved it. :) – blossom Jan 10 '17 at 1:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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