Search code examples
npmsolidity

Issue installing solc npm


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.


Solution

  • 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