我使用hyberledger-composer-common npm
模块和ionic
的组合遇到了问题。基本设置按预期工作,但当我尝试连接到hyperledger
网络时,它会引发以下错误:
Error: Failed to load connector module "composer-connector-hlfv1" for connection profile "Default". curmod.require is not a function-connectionManagerLoader.require is not a function-connectionManagerLoader.require is not a function-Cannot find module "."
at connectionProfileStore.load.then (connectionprofilemanager.js:160)
at t.invoke (polyfills.js:3)
at Object.onInvoke (core.es5.js:3890)
at t.invoke (polyfills.js:3)
at r.run (polyfills.js:3)
at polyfills.js:3
at t.invokeTask (polyfills.js:3)
at Object.onInvokeTask (core.es5.js:3881)
at t.invokeTask (polyfills.js:3)
at r.runTask (polyfills.js:3)
我很擅长使用ionic
和javascript
构建器,所以我不知道在哪里看。我猜它与polyfills
和ionic
处理路径的方式有关,但我不确定。任何人都可以给我一个正确的方向吗?
在尝试实例化loggerclass时,应用程序也会抛出类似的错误:
Failed to load logger module ./winstonInjector.js: Cannot find module "."
实施如下:
//example
var loggerToUse = './winstonInjector.js';
myLogger = require(loggerToUse);
这让我想到了关于动态加载模块的问题:)