0
const path=require('path');
const fs=require('fs');
const solc=require('solc');
const InboxPath=path.resolve(__dirname,'contracts','Inbox.sol');
const source=fs.readFileSync(InboxPath,'utf8');
solc.compile(source,1);

Here is my error:

kowsik@kowsik:~/Desktop/etherium_project$ node compile.js
assert.js:43
  throw new errors.AssertionError(obj);
  ^

AssertionError [ERR_ASSERTION]: Invalid callback specified.
    at wrapCallback (/home/kowsik/Desktop/etherium_project/node_modules/solc/wrapper.js:16:5)
    at runWithReadCallback (/home/kowsik/Desktop/etherium_project/node_modules/solc/wrapper.js:42:26)
    at compileStandard (/home/kowsik/Desktop/etherium_project/node_modules/solc/wrapper.js:83:14)
    at Object.compileStandardWrapper (/home/kowsik/Desktop/etherium_project/node_modules/solc/wrapper.js:90:14)
    at Object.<anonymous> (/home/kowsik/Desktop/etherium_project/compile.js:7:6)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
0

Use an older solc version for example "solc": "^0.4.25"

  • the command is : npm install --save solc@0.4.25 – Kowsik Gelli Dec 22 '18 at 12:00

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.