Hello everyone, I'm trying to install the solidity-coverage
package by using the command npm install --save-dev solidity-coverage
on Windows 10 with Node 12.
However, I'm getting the following error:
C:\Users\jan\dApp-nodeJS-webpack\app>npm install --save-dev solidity-coverage
npm WARN deprecated mkdirp-promise@5.0.1: This package is broken and no longer maintained. 'mkdirp' itself supports promises now, please switch to that.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm ERR! code ENOENT
npm ERR! syscall spawn git
npm ERR! path git
npm ERR! errno ENOENT
npm ERR! enoent Error while executing:
npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/web3-js/WebSocket-Node.git
npm ERR! enoent
npm ERR! enoent
npm ERR! enoent spawn git ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jan\AppData\Roaming\npm-cache\_logs\2020-08-04T08_08_54_546Z-debug.log
Steps to reproduce:
app
and init
npm project therenpm install --save-dev solidity-coverage
I'm on Windows 10 with Node 12.
Any help to fix the issue?
many thanks
TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
at /home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/utils.js:34:1
at new Promise (<anonymous>)
at /home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/utils.js:27:1
at /home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:101:1
at Array.map (<anonymous>)
at Object.compileSources (/home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:91:1)
at Object.compile (/home/node/project/node_modules/truffle/build/webpack:/packages/workflow-compile/legacy/index.js:54:1)
at plugin (/home/node/project/node_modules/solidity-coverage/plugins/truffle.plugin.js:101:29)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
I don't know how much it can help, but in anycase, my truffle version is
Truffle v5.1.45 (core: 5.1.45)
Solidity - 0.6.6 (solc-js)
Node v12.18.4
Web3.js v1.2.1
It broken when I migrated from 0.7.4 to 0.7.10.
Further tests I did show that it also breaking when I update other key packages to newer version.
It breaks only for coverage. Tests do continue to works fine.
ganache-cli
have a different format than those of ganache-core
(which solidity-coverage uses to launch an in-process server)...
total_accounts
Hey hi guys,
When running coverage , some tests are failing with this
ProviderError:
Could not connect to your Ethereum client with the following parameters:
- host > 127.0.0.1
- port > 8555
- network_id > *
Please check that your Ethereum client:
- is running
- is accepting RPC connections (i.e., "--rpc" option is used in geth)
- is accessible over the network
- is properly configured in your Truffle configuration file (truffle-config.js)
Please let me know how we can solve it ?
disableConfirmationListener: true
in whatever network you use to run your tests.--network <network-name>
hardhat_reset
to evm_snapshot
and evm_revert
@jo-es Yes, it's possible! There's a (rough draft) recipe of how do this in a Circle CI script here:
That might be over-complicated for your use case ... the basic idea is that you copy the coverage.json
file generated by each test run to a unique file name (coverage.json
is saved in your project's root directory). Then use a cli utility called istanbul-combine-updated
to merge the jsons
in a final step.
https://www.npmjs.com/package/istanbul-combine-updated?activeTab=readme