首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Hyperledger安装失败

Hyperledger安装失败
EN

Stack Overflow用户
提问于 2018-04-12 11:15:56
回答 2查看 1.3K关注 0票数 5

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

代码语言:javascript
复制
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运行测试失败,出现以下错误。有什么暗示吗?

代码语言:javascript
复制
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$
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2018-04-12 13:35:17

我遇到了同样的错误,您需要先运行命令(首先是检查图像 )

代码语言:javascript
复制
cd blockchain-explorer
npm install

代码语言:javascript
复制
cd blockchain-explorer/app/test
npm install
npm run test
票数 6
EN

Stack Overflow用户

发布于 2019-11-21 07:55:54

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

代码语言:javascript
复制
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“时,同时您应该在单独的窗口中从块资源管理器文件夹中启动./start.sh,以便您可以看到所有日志。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49795113

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档