如何修复“无法加载记录器模块./winstonInjector.js:找不到模块'./winstonInjector.js'”

时间:2019-09-16 09:39:38

标签: hyperledger-composer vue-cli winston

我用vue-cli 3.11.0创建了一个新项目。但每次我都需要compose-common模块(0.20.8)。控制台日志:无法加载记录器模块./winstonInjector.js:找不到模块'./winstonInjector.js'

const fg = require('composer-common').FileSystemCardStore;
const kj = require('composer-client').BusinessNetworkConnection;
module.exports = {

    cardStore: fg,
    BusinessNetworkConnection: kj,
    cardName: 'admin@pharmatrack',
    connection: {},

    connect: function (callback) {
        var cardtype = {type: 'composer-wallet-filesystem'}
        this.connection = new this.BusinessNetworkConnection(cardtype);

        return this.connection.connect(this.cardName).then(() => {
            callback();
        }).catch((err) => {
            callback(err);
        });
    },
    disconnect: function (callback) {
        this.connection.disconnect();
    },
    ping: function (callback) {
        return this.connection.ping().then((response) => {
            callback(response)
        }).catch((err) => {
            callback({}, err);
        });
    }
}


0 个答案:

没有答案