启动composer-rest-server时出错

问题描述 投票:0回答:2

我正在研究这个教程https://hyperledger.github.io/composer/tutorials/developer-guide.html

在我要通过运行命令启动composer-rest-server时生成REST API部分

composer-rest-server

我收到以下错误:

/home/../.nvm/versions/node/v6.11.4/lib/node_modules/composer-rest-server/node_modules/lodash-compat/internal/LodashWrapper.js:1
(function (exports, require, module, __filename, __dirname) { pf ZCALLBACK win32_open64_file_funcA (voidpf opaque,const void* filename,int mode)

SyntaxError: Unexpected identifier
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/home/../.nvm/versions/node/v6.11.4/lib/node_modules/composer-rest-server/node_modules/lodash-compat/chain/lodash.js:2:21)

我怎样才能解决这个问题?

ibm-cloud blockchain hyperledger-fabric hyperledger hyperledger-composer
2个回答
0
投票

尝试使用以下方法全局安装软件包:

npm install -g composer-rest-server

0
投票

首先卸载composer rest服务器

npm uninstall composer-rest-server

第二次安装

npm install -g [email protected] 

根据您的要求版本,然后在运行composer-rest-server之后,它会询问几个问题,如下所示。提供细节

composer-rest-server
? Enter the name of the business network card to use: admin@your-network-Name
? Specify if you want namespaces in the generated REST API: never use namespaces
? Specify if you want to use an API key to secure the REST API: No
? Specify if you want to enable authentication for the REST API using Passport: No
? Specify if you want to enable the explorer test interface: No
? Specify a key if you want to enable dynamic logging: No
? Specify if you want to enable event publication over WebSockets: Yes
? Specify if you want to enable TLS security for the REST API: No
© www.soinside.com 2019 - 2024. All rights reserved.