The currently top answer seems to be VisualStudio specific and seems strange to me...
But it helps changing
pragma solidity ^ "0.4.24"
(which would more commonly be written like this)
pragma solidity ^0.4.24
To this - WORKS (VisualStudio Code still shows error but it compiles)
pragma solidity 0.4.24;
Note that by doing this you fix your contract to that version...
The problem must have something to do with truffle 0.5 breaking changes and it makes sense according to the error message. Currently solidity github repo released 0.5 but truffle's according changes are still in beta so this might be a temporary issue where no consistent version exists...
Update: I think now it's safe to say upgrade if possible. Also there is a compiler section in truffle.js that could help to switch between solc versions