Home > front end >  Issue installing solc npm
Issue installing solc npm

Time:09-07

When I try to install solc (npm install solc or npm install -g solc) I actually can install it BUT when looking for it (through the command which solc) nothing shows up. Another strange thing: when looking for solcjs (through the command which solc) i get the correct path where it is indeed installed.

Things which I have already tried : uninstalling solc and solcjs and then re-installing them (which led to the same problem)

Other details : when I am in node.js and i try to do something like var solc = require('solc') no errors arise. Pretty strange one may think, well that's two of us.

Thanks in advance.

CodePudding user response:

Based on the solc command line usage documentation and this question on the ethereum stackexchange, you're not supposed to.

But, if you insist on doing so, it's best if you add solc's installation directory to your $PATH.

CodePudding user response:

I'm answering my own question to share the knowledge my collegue has finally shared with me: for my issue the following commands solved the problem (I did not initially mentioned that i was working on a MacOs my bad).

Step 1: Uninstall all possible version of solc (npm uninstall solc)

Step 2: brew tap ethereum/ethereum

Step 3: brew install solidity

This led to the correct creation of the path where solc is installed

  • Related