You should use options like --base-path and --include-path to avoid it
here is an example
./node_modules/.bin/solcjs --include-path ./node_modules/ --base-path ./contracts/ --evm-version constantinople ./contracts/GnosisSafe.sol --bin --abi
I wondered how could Uniswap compile its contract if Interfaces can't inherit from other Interfaces ? And I concluded that interfaces imports were added in later solidity versions.
The way I solved this problem was by changing interfaces pragma statement to match the main contract and instead of importing the interfaces and inheriting from it, I directly ...