【问题标题】:Hyperledger Explorer installation failsHyperledger Explorer 安装失败
【发布时间】:2018-09-22 12:31:24
【问题描述】:

我一直在尝试将 Hyperledger Explorer 安装到 Hyperledger Fabric (1.0) 的 AWS 实例上。我指的是https://github.com/hyperledger/blockchain-explorer提到的安装步骤,下面也有提到。

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

命令 npm run test 失败并出现以下错误。有什么提示吗?

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

> hyperledger-explorer@0.3.0 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 hyperledger-explorer-test@0.3.0 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 hyperledger-explorer-test@0.3.0 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

> hyperledger-explorer-test@0.3.0 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! hyperledger-explorer-test@0.3.0 test: `mocha *.js  --exit`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the hyperledger-explorer-test@0.3.0 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$

【问题讨论】:

    标签: node.js ubuntu npm hyperledger-fabric hyperledger


    【解决方案1】:

    我遇到了同样的错误,你需要先运行下面的命令 check image

    cd blockchain-explorer
    npm install
    

    cd blockchain-explorer/app/test
    npm install
    npm run test
    

    【讨论】:

    • 效果非常好!我希望有办法将此反馈传递给项目团队。
    【解决方案2】:

    尝试使用 sudo 运行所有命令。

    cd blockchain-explorer/app/test
    
    sudo npm install
    
    npm run test
    
    cd blockchain-explorer
    
    sudo npm install
    
    cd client/
    
    npm install
    
    npm test -- -u --coverage
    
    npm run build
    

    请忽略您在上述命令运行期间收到的所有错误和警告。

    当你运行“npm run build”时,你应该同时在单独的窗口中从区块链资源管理器文件夹中启动./start.sh,这样你就可以看到所有的日志。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-07-17
      • 2021-04-11
      • 2018-10-27
      • 2021-01-26
      • 2019-03-14
      • 2020-04-29
      • 1970-01-01
      相关资源
      最近更新 更多