I'm running a truffle project and have imported OpenZeppelin contracts.

While running truffle compile I'm facing following error:

ParserError: Source "github.com/OpenZeppelin/openzeppelin-solidity/contracts/math/SafeMath.sol" not found: 
File import callback not supported 
import "../math/SafeMath.sol"; 

How can I work around this issue?

It will be great if someone could help me understand what this error says.


the question is old but I'll answer it anyway,

if you use VS Code add

 "solidity.packageDefaultDependenciesContractsDirectory": "",
 "solidity.packageDefaultDependenciesDirectory": "node_modules"

in it's settings.json

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.