NodeJS 执行“测试”步骤时出错:错误:无法加载模块“@hyperledger/fabric-gateway”:语法错误:意外标记“,”

7vux5j2d  于 2023-06-29  发布在  Node.js
关注(0)|答案(1)|浏览(147)

执行“测试”步骤时出错:错误:无法加载模块“@hyperledger/fabric-gateway”:语法错误:意外的标记“.”卡尺基准测试引发此问题:Hyperledger fabric 2.4.6 caliper-cli 0.5.0 fabric-SUT 2.2

npx caliper launch manager --caliper-workspace ./ --caliper-networkconfig networks/fabric/test-network.yaml --caliper-benchconfig benchmarks/scenario/simple/config.yaml --caliper-flow-only-test --caliper-fabric-gateway-enabled --caliper-fabric-gateway-discovery

2022.11.14-11:14:46.705 info  [caliper] [cli-launch-manager]    Set workspace path: /home/anita/fabric/caliper-benchmarks
2022.11.14-11:14:46.706 info  [caliper] [cli-launch-manager]    Set benchmark configuration path: /home/anita/fabric/caliper-benchmarks/benchmarks/scenario/simple/config.yaml
2022.11.14-11:14:46.706 info  [caliper] [cli-launch-manager]    Set network configuration path: /home/anita/fabric/caliper-benchmarks/networks/fabric/test-network.yaml
2022.11.14-11:14:46.706 info  [caliper] [cli-launch-manager]    Set SUT type: fabric
2022.11.14-11:14:46.741 info  [caliper] [benchmark-validator]   No observer specified, will default to `none`
2022.11.14-11:14:46.741 info  [caliper] [caliper-engine]    Starting benchmark flow
2022.11.14-11:14:46.742 info  [caliper] [caliper-engine]    Skipping start commands due to benchmark flow conditioning
2022.11.14-11:14:46.742 info  [caliper] [caliper-engine]    Skipping initialization phase due to benchmark flow conditioning
2022.11.14-11:14:46.742 info  [caliper] [caliper-engine]    Skipping install smart contract phase due to benchmark flow conditioning
2022.11.14-11:14:46.783 error [caliper] [caliper-engine]    Error while performing "test" step: Error: Module "@hyperledger/fabric-gateway" could not be loaded: SyntaxError: Unexpected token '.'
Searched paths: /home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/caliper-core/lib/common/utils/node_modules,/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/caliper-core/lib/common/node_modules,/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/caliper-core/lib/node_modules,/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/caliper-core/node_modules,/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/node_modules,/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules,/home/anita/node_modules/@hyperledger/node_modules,/home/anita/node_modules,/home/node_modules,/node_modules
    at Function.loadModule (/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/caliper-core/lib/common/utils/caliper-utils.js:118:19)
    at Function.moduleIsInstalled (/home/anita/node_modules/@hyperledger/caliper-fabric/node_modules/@hyperledger/caliper-core/lib/common/utils/caliper-utils.js:181:26)
    at _determineInstalledNodeSDKandVersion (/home/anita/node_modules/@hyperledger/caliper-fabric/lib/FabricConnectorFactory.js:45:22)
    at CaliperEngine.connectorFactory [as adapterFactory] (/home/anita/node_modules/@hyperledger/caliper-fabric/lib/FabricConnectorFactory.js:132:17)
    at CaliperEngine.run (/home/anita/node_modules/@hyperledger/caliper-cli/node_modules/@hyperledger/caliper-core/lib/manager/caliper-engine.js:149:64)
    at Function.handler (/home/anita/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchManager.js:62:43)
    at Object.module.exports.handler (/home/anita/node_modules/@hyperledger/caliper-cli/lib/launch/launchManagerCommand.js:46:44)
    at Object.runCommand (/home/anita/node_modules/@hyperledger/caliper-cli/node_modules/yargs/lib/command.js:240:40)
    at Object.parseArgs [as _parseArgs] (/home/anita/node_modules/@hyperledger/caliper-cli/node_modules/yargs/yargs.js:1154:41)
    at Object.runCommand (/home/anita/node_modules/@hyperledger/caliper-cli/node_modules/yargs/lib/command.js:198:30)
2022.11.14-11:14:46.783 info  [caliper] [caliper-engine]    Skipping end command due to benchmark flow conditioning
2022.11.14-11:14:46.783 error [caliper] [cli-launch-manager]    Benchmark failed with error code 6 

Error: Benchmark failed with error code 6
at Function.handler (/home/anita/node_modules/@hyperledger/caliper-cli/lib/launch/lib/launchManager.js:70:23)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
mec1mxoz

mec1mxoz1#

我遇到了这个错误。诀窍在于作为先决条件安装的工具的版本。您需要确保节点和npm的版本相互支持。

相关问题