0

enter image description hereI was trying with a simple contract,when I do "node compile.js" in my windows cmd it throws an error.I was using vscode it showing error in const solc = require('solc'),I installed everything perfectly but I don't know why the error occurs.

New contributor
Arun Karthick is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
  • 1
    Hi there. How have you installed solc in your project? What are the contents of your package.json file? – Richard Horrocks Dec 2 at 23:24
  • Hi! Thanks for replying.In package.json file i have solc in dependencies even though i am getting this error – Arun Karthick Dec 3 at 9:04
  • Okay - how have you installed solc? require() searches the modules installed in the project directory's node_modules folder, so this error is basically saying it's not there. Did you do npm install solc? I'd suggest just working at getting the examples from the NPM page working as a start -> npmjs.com/package/… – Richard Horrocks Dec 3 at 9:58
  • I used Solidity compiler version 0.4.17 in my contract ,i also installed this in the project folder by "npm install --save solc@0.4.17".Still I was not able to tackle the error,is any other method is there? And I was able to find solc folder in node_modules directory. – Arun Karthick Dec 3 at 12:00
  • Okay, in that case I'm not sure what's happening. Can you include the Node code that has the error? Note that version 0.4.17 is now 2 years old - you should think about using at least version 0.5.0 and above as there were various important changes. – Richard Horrocks Dec 3 at 12:38

Your Answer

Arun Karthick is a new contributor. Be nice, and check out our Code of Conduct.

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

Browse other questions tagged or ask your own question.