Error: Failed to fetch the Solidity compiler

Viewed 534

I am new to Truffle and going through the Metacoin tutorial; I followed all the steps but when I do truffle compile, I get the following:

Error: Failed to fetch the Solidity compiler from the following locations: https://relay.trufflesuite.com/solc/bin/,https://solc-bin.ethereum.org/bin/,https://ethereum.github.io/solc-bin/bin/. Are you connected to the internet?

I am connected to Internet and using: Truffle v5.5.26 (core: 5.5.26) Ganache v7.4.0 Solidity - 0.8.13 (solc-js) Node v16.13.1 Web3.js v1.7.4

1 Answers

I had the same error recently and fixed it by using the command sudo truffle compile. This error happened because Truffle will need to install new dependencies, which will require an administrative privilege. Please note that this solution might work on a Linux or Mac OS. It would be best if you ran Windows power shell or Terminal as an administrator to get admin access and install dependencies through the Terminal.

I hope this helps you solve your issue as well.

Related