I am trying to compile solidity smart contract using npm solc. I tried to follow different examples. Link to example: https://medium.com/coinmonks/how-to-compile-a-solidity-sma
This is because the version mismatch of Solidity compiler. Please note or verify the solidity compiler version in which you want to work. For example: If you are doing work in
pragma solidity ^0.4.17
then you have to install 0.4.17 solidity compiler version like this:
npm install solc@0.4.17
in the command prompt or terminal.