I've done npm install -g solc@0.4.16
and it reads solc@0.5.16
when doing the truffle version
compilers: {
solc: {
version: "^0.4.26", // A version or constraint - Ex. "^0.5.0"
// Can also be set to "native" to use a native solc
//docker: <boolean>, // Use a version obtained through docker
parser: "solcjs", // Leverages solc-js purely for speedy parsing
//settings: {
// optimizer: {
// enabled: <boolean>,
// runs: <number> // Optimize for how many times you intend to run the code
// },
// evmVersion: <string> // Default: "petersburg"
// }
}
}
truble
CompileError: /C/Users/imama/Documents/token_sale/contracts/DappToken.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.26;
^----------------------^
,/C/Users/imama/Documents/token_sale/contracts/DappTokenSale.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.26;
^----------------------^
,/C/Users/imama/Documents/token_sale/contracts/Migrations.sol:1:1: ParserError: Source file requires different compiler version (current compiler is 0.5.16+commit.9c3226ce.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version
pragma solidity ^0.4.26;
^----------------------^
parser: "solcjs"
line? – Ismael Oct 16 '20 at 17:14