Skip to content

Can't install on Ubuntu 16.04.3 #256

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
guoguo0406 opened this issue Jul 4, 2018 · 7 comments
Closed

Can't install on Ubuntu 16.04.3 #256

guoguo0406 opened this issue Jul 4, 2018 · 7 comments

Comments

@guoguo0406
Copy link

Hi,
I meet the below error when try to install on ubuntu 16.04.3 via "npm install --save-dev solidity-coverage", who can help me to fix it?

npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "i" "solidity-coverage"
npm ERR! node v4.2.6
npm ERR! npm v3.5.2
npm ERR! code ENOSELF

npm ERR! Refusing to install solidity-coverage as a dependency of itself
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues

npm ERR! Please include the following file with any support request:
npm ERR! /home/ubuntu/solidity-coverage/npm-debug.log

@guoguo0406
Copy link
Author

ubuntu@ip-172-18-1-199:~/solidity-coverage$ vi npm-debug.log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/nodejs',
1 verbose cli '/usr/bin/npm',
1 verbose cli 'install',
1 verbose cli '--save-dev',
1 verbose cli 'solidity-coverage' ]
2 info using [email protected]
3 info using [email protected]
4 silly loadCurrentTree Starting
5 silly install loadCurrentTree
6 silly install readLocalPackageData
7 silly fetchPackageMetaData solidity-coverage
8 silly fetchNamedPackageData solidity-coverage
9 silly mapToRegistry name solidity-coverage
10 silly mapToRegistry using default registry
11 silly mapToRegistry registry https://registry.npmjs.org/
12 silly mapToRegistry uri https://registry.npmjs.org/solidity-coverage
13 verbose request uri https://registry.npmjs.org/solidity-coverage
14 verbose request no auth needed
15 info attempt registry request try #1 at 2:38:34 AM
16 verbose request id b0fb16e756684ea3
17 http request GET https://registry.npmjs.org/solidity-coverage
18 http 200 https://registry.npmjs.org/solidity-coverage
19 verbose headers { date: 'Wed, 04 Jul 2018 02:38:35 GMT',
19 verbose headers 'content-type': 'application/json; charset=UTF-8',
19 verbose headers 'transfer-encoding': 'chunked',
19 verbose headers connection: 'keep-alive',
19 verbose headers 'set-cookie': [ '__cfduid=d059dce864eec1e897f689ef1b9c2727f1530671914; expires=Thu, 04-Jul-19 02:38:34 GMT; path=/; domain=.registry.npmjs.org; HttpOnly' ],
19 verbose headers 'cache-control': 'max-age=300',
19 verbose headers 'cf-cache-status': 'REVALIDATED',
19 verbose headers 'cf-ray': '434e376819323168-SIN',
19 verbose headers etag: 'W/"ec973e0c2becd8e8108650484c11719e"',
19 verbose headers 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
19 verbose headers 'last-modified': 'Mon, 02 Jul 2018 00:30:59 GMT',
19 verbose headers vary: 'accept-encoding, accept',
19 verbose headers server: 'cloudflare',
19 verbose headers 'content-encoding': 'gzip' }
20 silly get cb [ 200,
20 silly get { date: 'Wed, 04 Jul 2018 02:38:35 GMT',
20 silly get 'content-type': 'application/json; charset=UTF-8',
20 silly get 'transfer-encoding': 'chunked',
20 silly get connection: 'keep-alive',
20 silly get 'set-cookie': [ '__cfduid=d059dce864eec1e897f689ef1b9c2727f1530671914; expires=Thu, 04-Jul-19 02:38:34 GMT; path=/; domain=.registry.npmjs.org; HttpOnly' ],
20 silly get 'cache-control': 'max-age=300',
20 silly get 'cf-cache-status': 'REVALIDATED',
20 silly get 'cf-ray': '434e376819323168-SIN',
20 silly get etag: 'W/"ec973e0c2becd8e8108650484c11719e"',
20 silly get 'expect-ct': 'max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"',
20 silly get 'last-modified': 'Mon, 02 Jul 2018 00:30:59 GMT',
20 silly get vary: 'accept-encoding, accept',
20 silly get server: 'cloudflare',
20 silly get 'content-encoding': 'gzip' } ]
21 verbose get saving solidity-coverage to /home/ubuntu/.npm/registry.npmjs.org/solidity-coverage/.cache.json
22 verbose makeDirectory /home/ubuntu/.npm creation not in flight; initializing
23 silly makeDirectory /home/ubuntu/.npm uid: 1000 gid: 1000
24 silly install normalizeTree
25 silly loadCurrentTree Finishing
26 silly loadIdealTree Starting
27 silly install loadIdealTree
28 silly cloneCurrentTree Starting
29 silly install cloneCurrentTreeToIdealTree
30 silly cloneCurrentTree Finishing
31 silly loadShrinkwrap Starting
32 silly install loadShrinkwrap
33 silly loadShrinkwrap Finishing
34 silly loadAllDepsIntoIdealTree Starting
35 silly install loadAllDepsIntoIdealTree
36 silly rollbackFailedOptional Starting
37 silly rollbackFailedOptional Finishing
38 silly runTopLevelLifecycles Starting
39 silly runTopLevelLifecycles Finishing
40 silly install printInstalled
41 verbose stack Error: Refusing to install solidity-coverage as a dependency of itself
41 verbose stack at checkSelf (/usr/share/npm/lib/install/validate-args.js:40:14)
41 verbose stack at Array. (/usr/share/npm/node_modules/slide/lib/bind-actor.js:15:8)
41 verbose stack at LOOP (/usr/share/npm/node_modules/slide/lib/chain.js:15:14)
41 verbose stack at chain (/usr/share/npm/node_modules/slide/lib/chain.js:20:5)
41 verbose stack at /usr/share/npm/lib/install/validate-args.js:15:5
41 verbose stack at /usr/share/npm/node_modules/slide/lib/async-map.js:52:35
41 verbose stack at Array.forEach (native)
41 verbose stack at /usr/share/npm/node_modules/slide/lib/async-map.js:52:11
41 verbose stack at Array.forEach (native)
41 verbose stack at asyncMap (/usr/share/npm/node_modules/slide/lib/async-map.js:51:8)
42 verbose cwd /home/ubuntu/solidity-coverage
43 error Linux 4.4.0-1052-aws
44 error argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save-dev" "solidity-coverage"
45 error node v4.2.6
46 error npm v3.5.2
47 error code ENOSELF
48 error Refusing to install solidity-coverage as a dependency of itself
49 error If you need help, you may report this error at:
49 error https://github.com/npm/npm/issues
50 verbose exit [ 1, true ]

@cgewecke
Copy link
Member

cgewecke commented Jul 4, 2018

@qinghua0120 solidity-coverage is a development dependency you install in a truffle project.

Example installation

mkdir myProject
cd myProject
truffle init
npm init
npm install --save-dev solidity-coverage

@guoguo0406
Copy link
Author

@cgewecke
I am not use the truffle.
Currently i use the Remix to make a smart contract and pass the testing on ropsten.
I want to use the solidity-coverage to check the code of smart contract.
Can u use it in windows 10?

@cgewecke
Copy link
Member

cgewecke commented Jul 4, 2018

How are you testing your contracts? The tool runs your unit tests and reports which lines of your contracts were executed during them. There are some notes about running on Windows in the README.

@guoguo0406
Copy link
Author

I testing it via the metamask, call the contract between different account. But i think the testing is not enough, so i try to find some tools to do the code testing.
The unit test case should write by myself?

@cgewecke
Copy link
Member

cgewecke commented Jul 4, 2018

Yes exactly @qinghua0120. Truffle is a common tool people use and for various reasons solidity-coverage currently assumes your project is organized with it.

Other ethereum testing frameworks you might be interested in:

  • 0xProject (they have their own coverage tool).
  • Embark - it might be possible to adapt solidity-coverage to evalute its tests, not sure.
  • Buildler - this tool is designed to be truffle-compatible and it probably could use solidity-coverage pretty easily.

I would encourage you just to write tests in a framework you like and validate your code that way. Code coverage is useful for audits and if you're really concerned that your tests are hitting every line of your code. But it's just a measurement.

@cgewecke
Copy link
Member

cgewecke commented Jul 4, 2018

I'm going to close this because it seems like your installation issue related to not installing within the context of a solidity project.

@cgewecke cgewecke closed this as completed Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants