我正在通過Hyperledger Developer Guide Tutorial。我已經完成了通過生成REST API的步驟,沒有任何問題。在經過生成您的Skeleton Web應用程序部分後,我在shell輸出中看不到任何問題,但是當我嘗試根據指示導航到端口4200時,出現一個空白屏幕Invalid Host header
。「無效的主機頭」啓動框架Web應用程序Hyperledger開發者指南教程
在Rocketchat的#composer頻道中,我看到有人有similar problem。有人建議,這是:
因爲在 keyValStore在您的個人資料hlfv1指定的目錄無法創建或訪問。很可能你有 指定了一個目錄,例如/home/fred/.hfc-key-store,但用戶 fred不存在,因此/ home/fred目錄不存在。一個 解決方案將只是爲了自己創建目錄路徑。
我檢查,我的目錄是確定:
[email protected]:~/repos$ cat /home/ibmadmin/.composer-connection-profiles/hlfv1/connection.json
{
"type": "hlfv1",
"orderers": [
{ "url" : "grpc://localhost:7050" }
],
"ca": { "url": "http://localhost:7054",
"name": "ca.org1.example.com"
},
"peers": [
{
"requestURL": "grpc://localhost:7051",
"eventURL": "grpc://localhost:7053"
}
],
"keyValStore": "/home/ibmadmin/.composer-credentials",
"channel": "composerchannel",
"mspID": "Org1MSP",
"timeout": "300"
}
[email protected]:~/repos$ ls -ld /home/ibmadmin/.composer-credentials
drwxrwxr-x 2 ibmadmin ibmadmin 4096 Sep 13 15:11 /home/ibmadmin/.composer-credentials
[email protected]:~/repos$ ls -l /home/ibmadmin/.composer-credentials
total 24
-rw-r--r-- 1 ibmadmin ibmadmin 246 Sep 13 15:10 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-priv
-rw-r--r-- 1 ibmadmin ibmadmin 182 Sep 13 15:11 114aab0e76bf0c78308f89efc4b8c9423e31568da0c340ca187a9b17aa9a4457-pub
-rw-rw-r-- 1 ibmadmin ibmadmin 246 Sep 13 15:11 2a176af765281bb00394c2427cb7acc679d3eb9b504703eaba8c32a5a0f1a61c-priv
-rw-rw-r-- 1 ibmadmin ibmadmin 182 Sep 13 15:40 2a176af765281bb00394c2427cb7acc679d3eb9b504703eaba8c32a5a0f1a61c-pub
-rw-rw-r-- 1 ibmadmin ibmadmin 962 Sep 13 15:40 admin
-rw-r--r-- 1 ibmadmin ibmadmin 1024 Sep 13 15:11 PeerAdmin
[email protected]:~/repos$
有沒有人有什麼建議?
更新
我加了這樣一句話:
$ diff -C5 node_modules/@angular/cli/tasks/serve.js.orig node_modules/@angular/cli/tasks/serve.js
*** node_modules/@angular/cli/tasks/serve.js.orig 2017-09-14 12:20:45.462357278 -0400
--- node_modules/@angular/cli/tasks/serve.js 2017-09-14 11:27:55.682265096 -0400
***************
*** 158,167 ****
--- 158,168 ----
ui.writeLine(chalk.green(common_tags_1.oneLine `
**
NG Live Development Server is running on ${serverAddress}
**
`));
+ webpackDevServerConfiguration.disableHostCheck = true;
const server = new WebpackDevServer(webpackCompiler, webpackDevServerConfiguration);
return new Promise((_resolve, reject) => {
server.listen(serveTaskOptions.port, serveTaskOptions.host, (err, _stats) => {
if (err) {
return reject(err);
$
謝謝,丹。這很好。我添加了這個聲明: – pfuntner