0

当我尝试通过命令 (./start.sh) 启动资源管理器时,会出现此消息(***** 请检查日志 [logs/console/console-2019-08-09.log] 是否有任何错误** ***)

日志文件内容:

module.js:550
    throw err;
    ^
Error: Cannot find module 'helmet'
    at Function.Module._resolveFilename (module.js:548:15)
    at Function.Module._load (module.js:475:25)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/shikah/fabric/blockchain-explorer/main.js:11:16)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)

在 main.js 文件中,我尝试将“require”替换为“import”,但并没有解决问题。

Main.js 文件内容:

//Part of the main.js file:

const express = require('express');   
const helmet = require('helmet');
const path = require('path');
const http = require('http');
const https = require('https');
const fs = require('fs');
const url = require('url');
const WebSocket = require('ws');
const appconfig = require('./appconfig.json');
const helper = require('./app/common/helper');
4

1 回答 1

0

从这里关注最新的教程:https ://github.com/hyperledger/blockchain-explorer

./main.sh install
--to install, run tests, and build project

./main.sh clean
--to clean the /node_modules, client/node_modules client/build, client/coverage, app/test/node_modules directories

./main.sh test
--to test REST API, and UI components
--to generate code coverage report

在您的情况下,首先运行./main.sh clean然后./main.sh install

希望能解决

于 2019-10-03T15:08:30.220 回答