Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hyperledger Explorer installation fails

I have been trying to install Hyperledger Explorer onto the AWS instance of Hyperledger Fabric (1.0). I am referring to the installations steps mentioned at https://github.com/hyperledger/blockchain-explorer, which are mentioned below too.

cd blockchain-explorer/app/test

npm install

npm run test

cd blockchain-explorer

npm install

cd client/

npm install

npm test -- -u --coverage

npm run build

The command npm run test has been failing with the following error. Any hints?

ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-exp                                                                                                                     lorer$ npm run test

> [email protected] test /home/ubuntu/gopath/src/github.com/hyperledger                                                                                                                     /fabric/blockchain-explorer
> echo 'Error: no test specified'

Error: no test specified
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-exp                                                                                                                     lorer$ cd ..
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric$ cd examples/e                                                                                                                     2e_cli/
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/examples/e2e_c                                                                                                                     li$ npm run test
npm ERR! path /home/ubuntu/gopath/src/github.com/hyperledger/fabric/examples/e2e                                                                                                                     _cli/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/home/ubuntu/gopath/src                                                                                                                     /github.com/hyperledger/fabric/examples/e2e_cli/package.json'
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!     /home/ubuntu/.npm/_logs/2018-04-12T11_02_45_161Z-debug.log
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/examples/e2e_cli$ cd ..                                                                                                            ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/examples$ cd ..
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric$ cd blockchain-explorer/
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer$ cd app/test/
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ npm install
npm WARN [email protected] No repository field.

up to date in 1.802s
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ sudo npm install
npm WARN [email protected] No repository field.

up to date in 1.725s
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ ls -all
total 104
drwxrwxr-x  3 ubuntu ubuntu  4096 Apr 12 10:39 .
drwxrwxr-x 11 ubuntu ubuntu  4096 Apr 12 10:11 ..
drwxrwxr-x 61 ubuntu ubuntu  4096 Apr 12 10:39 node_modules
-rw-rw-r--  1 ubuntu ubuntu   433 Apr 12 10:39 package.json
-rw-rw-r--  1 ubuntu ubuntu 83488 Apr 12 10:39 package-lock.json
-rw-rw-r--  1 ubuntu ubuntu   519 Apr 12 10:11 test.js
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ vi package.json
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ vi package.json
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ clear
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$ npm run test

> [email protected] test /home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test
> mocha *.js  --exit

module.js:549
    throw err;
    ^

Error: Cannot find module 'log4js'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/helper.js:17:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test/test.js:7:14)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at /home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test/node_modules/mocha/lib/mocha.js:228:14)
    at Mocha.run (/home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test/node_modules/mocha/lib/mocha.js:536:10)
    at Object.<anonymous> (/home/ubuntu/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test/node_modules/mocha/bin/_mocha:582:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Function.Module.runMain (module.js:693:10)
    at startup (bootstrap_node.js:188:16)
    at bootstrap_node.js:609:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] test: `mocha *.js  --exit`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/ubuntu/.npm/_logs/2018-04-12T11_08_28_132Z-debug.log
ubuntu@ip-172-31-2-180:~/gopath/src/github.com/hyperledger/fabric/blockchain-explorer/app/test$
like image 644
Nikhil Khedkar Avatar asked Apr 12 '18 11:04

Nikhil Khedkar


1 Answers

I was getting same error , you need to run below commands first check image

cd blockchain-explorer
npm install

than

cd blockchain-explorer/app/test
npm install
npm run test
like image 67
PREETAM YADAV Avatar answered Oct 31 '22 23:10

PREETAM YADAV