I installed the latest version of truffle, solc, node and also installed new version of openzeppelin-solidity library in my project.
Changed the truffle-config.js to use new solc version. My contract inherits from the openzeppelin library. Now when i run truffle compile, it give me the following error.
Error parsing openzeppelin-solidity/contracts/ownership/Ownable.sol: ParsedContract.sol:8:1: ParserError: Source file requires different compiler version (current compiler is 0.5.2+commit.1df8f40c.Emscripten.clang - note that nightly builds are considered to be strictly less than the released version contract Ownable { ^------^
Here are the versions for everything I'm using:
$truffle version Truffle v5.0.0 (core: 5.0.0) Solidity - 0.5.2 (solc-js) Node v11.4.0
$ solc --version solc, the solidity compiler commandline interface Version: 0.5.2+commit.1df8f40c.Linux.g++
openzeppelin-solidity package.json has this "_from": "openzeppelin-solidity", "_id": "[email protected]", .... "version": "2.0.0"
Now the Ownable contract uses compiler version ^0.4.24, which would be the case for all the contracts in the library.
Any ideas why this is happening and how to fix this?