[英]How to enable authentication in hyperledger Angular application
通過成功完成本教程,我已將Hyperledger作曲家區塊鏈部署到多個組織。
我已經通過使用命令yo hyperledger-composer:angular
通過選擇選項使用現有網絡並生成新的rest api生成了angular2應用程序。
當我啟動應用程序時,它成功了,我可以使用URL http:// localhost:4200從hyperledgercomposer瀏覽資產和參與者。
現在,我想通過遵循本教程並按如下所示編輯angular2應用程序的package.json文件來啟用已安裝passport-github
和配置導出選項的其余身份驗證,以便在啟動時啟用身份驗證
"app": "composer-rest-server --card admin@some-network -n never -p 3000 -m true"
我添加了-m true選項,以便在使用npm start
命令啟動angular2應用程序時默認啟用身份驗證。
當我啟動應用程序時,出現以下錯誤。 如何解決呢?
[0] ** NG Live Development Server is running on http://localhost:4200 **
[0] 10% building modules 4/4 modules 0 activeDiscovered types from business network definition
[1] Generating schemas for all types in business network definition ...
[1] Generated schemas for all types in business network definition
[1] Adding schemas for all types to Loopback ...
[1] Added schemas for all types to Loopback
[1] { Error: Cannot find module 'passport-github'
[1] at Function.Module._resolveFilename (module.js:536:15)
[1] at Function.Module._load (module.js:466:25)
[1] at Module.require (module.js:579:17)
[1] at require (internal/module.js:11:18)
[1] at PassportConfigurator.configureProvider (/home/user/tmt/TMT-Innovation-AngApp/node_modules/loopback-component-passport/lib/passport-configurator.js:158:22)
[1] at Promise.then (/home/user/tmt/TMT-Innovation-AngApp/node_modules/composer-rest-server/server/server.js:133:38)
[1] at <anonymous>
[1] at process._tickCallback (internal/process/next_tick.js:188:7) code: 'MODULE_NOT_FOUND' }
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
[1] npm ERR! TMT-Innovation-AngApp@0.0.1 app: `composer-rest-server --card admin@some-network -n never -p 3000 -m true`
[1] npm ERR! Exit status 1
[1] npm ERR!
嘗試npm install -g passport-github
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.