question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Truffle package zeppelin-solidity isn't found

See original GitHub issue

Hello!

I’m trying to generate coverage for this project https://github.com/mixbytes/storiqa_ico/tree/036a57a6c71599b643145f4ec4e77d86b360dec1.

and encountering an error

$ ./node_modules/.bin/solidity-coverage
Generating coverage environment
Instrumenting  ./coverageEnv/contracts/crowdsale/FixedTimeBonuses.sol
Instrumenting  ./coverageEnv/contracts/crowdsale/FundsRegistry.sol
Skipping instrumentation of  ./coverageEnv/contracts/Migrations.sol
Instrumenting  ./coverageEnv/contracts/ownership/multiowned.sol
Instrumenting  ./coverageEnv/contracts/ownership/MultiownedControlled.sol
Instrumenting  ./coverageEnv/contracts/ownership/SimpleMultiSigWallet.sol
Instrumenting  ./coverageEnv/contracts/STQCrowdsale.sol
Instrumenting  ./coverageEnv/contracts/STQToken.sol
Instrumenting  ./coverageEnv/contracts/test_helpers/crowdsale/FundsRegistryTestHelper.sol
Instrumenting  ./coverageEnv/contracts/test_helpers/STQCrowdsaleTestHelper.sol
Instrumenting  ./coverageEnv/contracts/test_helpers/token/MintableMultiownedTokenTestHelper.sol
Instrumenting  ./coverageEnv/contracts/token/CirculatingToken.sol
Instrumenting  ./coverageEnv/contracts/token/MintableMultiownedToken.sol
Launched testrpc on port 8555
Running: truffle test  
(this can take a few seconds)...
Using network 'development'.

Error: Could not find zeppelin-solidity/contracts/ReentrancyGuard.sol from any sources; imported from /home/e/storiqa_ico/coverageEnv/contracts/STQCrowdsale.sol
    at /home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:49111:23
    at /home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:60660:16
    at next (/home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:69109:18)
    at /home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:49099:7
    at /home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:96498:5
    at /home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:69014:16
    at replenish (/home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:60630:25)
    at iterateeCallback (/home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:60620:17)
    at /home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:60660:16
    at ReadFileContext.callback (/home/e/storiqa_ico/node_modules/truffle/build/cli.bundled.js:96494:14)
Cleaning up...

zeppelin-solidity is used in the project as a package as described in truffle docs and installed locally in /home/e/storiqa_ico/node_modules/zeppelin-solidity/. Truffle does’t have any problems searching for zeppelin-solidity includes when invoked from the project root directory.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
codingyourlifecommented, May 8, 2018

I found this easily via google and thought it makes sense to post what needs to be added to .solcover.js to make it clear to everyone

module.exports = { 
    copyNodeModules: true
}

It is also possible to add the specific package like this

module.exports = { 
    copyPackages: ['zeppelin-solidity']
}
1reaction
cgeweckecommented, Sep 10, 2017

Hi @Eenae. If you are importing contracts from npm into your solidity files you can explicitly request that node_modules is included in the coverage environment by creating a .solcover.js config file and setting the copyNodeModules option to true. See the README for more details.

Thanks for opening this - I think it will be helpful to anyone using Zeppelin base contracts to have this in the issues history.

Closing because it’s addressed by the existing docs. Please feel free to reopen if you continue to run into problems with this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

truffle compile error: could not find zeppelin-solidity/contracts
I can see zeppelin-solidity in the /usr/local/lib/node_modules on my mac. I created project with truffle init , but in one of my contracts,...
Read more >
Truffle compiler can't find open zeppelin contracts
I get an error message when I try to compile. I checked inside node_modules and all the contracts are there. im running truffle...
Read more >
Truffle compiler error: Requested contract not found - Support
Hi everyone, I am trying to do some really simple compile and deploy with truffle but run into this error: Error: The requested...
Read more >
“ParserError: Source “openzeppelin/contracts/token/*.sol” not ...
Therefore, truffle cannot locate the @openzeppelin/contracts package. To solve this, run the npm init command in the directory containing the node_modules ...
Read more >
Open Zeppelin (TutorialToken) tutorial - Truffle Suite
The most recent version of OpenZeppelin can be found as an npm package. npm install openzeppelin-solidity. Creating the "TutorialToken" smart contract¶. With ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found