How to Change the Solidity Compiler in VS Code

Easily Change Solidity Compiler Versions

Michael Macaulay
Dapp Dev Tips

--

Solidity development is fun. But challenging. Luckily, there’s a VS Code extension created by Juan Blanco (and endorsed by the Ethereum foundation) that makes things just a bit easier. It’s called Solidity.

If you use it, you’ve likely seen an error like this before.

Source file requires different compiler version (current compiler is 0.8.6+commit.11564f7e.Emscripten.clang) — note that nightly builds are considered to be strictly less than the released version

Don’t worry, there’s an easy fix!

Right click the pragma solidity statement, and select the following option:

Solidity: Change workspace compiler version (Remote)

Then, all you have to do is select the Solidity compiler you want.

Here’s a gif of me fixing the problem.

--

--