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.

Prompt to run truffle init

See original GitHub issue

If I run solidity-coverage in a directory where truffle hasn’t been initialised, I get:

Generating coverage environment
ls: no such file or directory: ./coverageEnv/contracts/**/*.sol
Launched testrpc on port 8555
Running: truffle test
(this can take a few seconds)...
/usr/lib/node_modules/truffle/build/cli.bundled.js:213349
      files = files.filter(function(file) {
                   ^

TypeError: Cannot read property 'filter' of undefined
    at /usr/lib/node_modules/truffle/build/cli.bundled.js:213349:20
    at /usr/lib/node_modules/truffle/build/cli.bundled.js:214669:25
    at FSReqWrap.oncomplete (fs.js:153:21)
Cleaning up...

        There was an error generating coverage. Possible reasons include:
        1. Another application is using port 8555
        2. Truffle crashed because your tests errored

      Error: ENOENT: no such file or directory, open './allFiredEvents'
Exiting without generating coverage...

I’m a noob, but it took me a while to work out what was going on.

Perhaps check if files is undefined and say something like:

"Can’t find truffle files. Have you run “truffle init”?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
HaleTomcommented, Nov 5, 2017

Welcome 😃 The link I gave says it would be better to use:

Your test runner (Truffle?) crashed because the tests encountered an error.

Perhaps s/crashed/failed/

0reactions
cgeweckecommented, Nov 5, 2017

Will do. Thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Command line options - Truffle Suite
Run a console with contract abstractions and commands available. ... to be available through `truffle init` should use `truffle unbox MetaCoin` instead.
Read more >
Creating your First Truffle Project (part 1 of 2) - Ippon
This is an introduction on how to get started with a Truffle-based Solidity project. This article series will not only explain how to...
Read more >
Learn Truffle and Ganache – How to Create and Deploy a ...
To start a project in Truffle, go into a directory and type the init command. truffle init. Screenshot-2022-07-16-193451. This will create a new ......
Read more >
Truffle commands - DApp develop framework | PlatON
--interactive : Prompt to confirm that the user wants to proceed after the dry run. networks¶. Show addresses for deployed contracts on each...
Read more >
Command reference - Truffle Suite
Once the console starts, you can then use your contracts via the command line like you would in your code. Additionally, all truffle...
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