evote icon indicating copy to clipboard operation
evote copied to clipboard

FileSystemWallet is not a constructor

Open phokusm2000 opened this issue 4 years ago • 1 comments

Good day all,

Kindly assist with this error:

PS C:\Users\CCSA\Desktop\evote-master\web-app\server> node enrollAdmin.js Failed to enroll admin user ' + app-admin + : TypeError: FileSystemWallet is not a constructor FileSystemWallet_Error

Thank-you!

phokusm2000 avatar Oct 26 '20 10:10 phokusm2000

I am stuck at the same place :

Background :

  1. I am using IBM Blockchain env [ from market place latets version 2.0 ] on VSCode [ Version: 1.52.1 ] with node v12.7.0 and npm 6.10.

  2. I did git clone https://github.com/IBM/evote.

  3. Top of this I had to adjust to get the Fabric Smart contract to work on Fabric version 2 ( which is the current latest provided local env for VSCode ] by following https://github.com/IBM/evote/issues/43.
    "dependencies": { "fabric-contract-api": "1.4.5", "fabric-shim": "^1.4.5", "mem": "^5.1.1", "os-locale": "^4.0.0" },

  4. Then while starting the server from the server folder , npm start it will fail I had adjust by updating the package.json inside server by .. "nodemon": "^2.0.7", "fabric-ca-client": "^1.4.5",

  5. Then Server/Client starts after npm install and npm rebuild.

  6. Then looking at at App running at:

  • Local: http://localhost:8082/
  • Network: unavailable We see the page coming up properly.
  1. Now if you try adding a user

image

it will be the following error

::1 - - [01/Feb/2021:01:42:07 +0000] "OPTIONS /registerVoter HTTP/1.1" 204 0 "http://localhost:8082/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36" req.body: { voterId: '1234', registrarId: '2345', firstName: 'sss', lastName: 'sss' } registrarId 2345 voterId 1234 Failed to register user + 1234 + : TypeError: FileSystemWallet is not a constructor response from registerVoter: { error: TypeError: FileSystemWallet is not a constructor at Object.exports.registerVoter (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/src/fabric/network.js:179:20) at /Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/src/app.js:83:32 at Layer.handle [as handle_request] (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/layer.js:95:5) at next (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/route.js:137:13) at Route.dispatch (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/route.js:112:3) at Layer.handle [as handle_request] (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/layer.js:95:5) at /Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/index.js:281:22 at Function.process_params (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/index.js:335:12) at next (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/express/lib/router/index.js:275:10) at cors (/Users/saikatsahoo/SaikatRepo/07_SwPrg_workspaces/eVote/evote/web-app/server/node_modules/cors/lib/index.js:188:7) } ::1 - - [01/Feb/2021:01:42:07 +0000] "POST /registerVoter HTTP/1.1" 200 1539 "http://localhost:8082/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 11_1_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.96 Safari/537.36"

  1. Error even using web-app\server> node enrollAdmin.js Failed to enroll admin user ' + app-admin + : TypeError: FileSystemWallet is not a constructor

  2. I have hit the same issue with other fabcar codebase .... with this FileSystemWallet issue.

kokirieducare avatar Feb 01 '21 01:02 kokirieducare