IBM / evote

A voting application that leverages Hyperledger Fabric and the IBM Blockchain Platform to record and tally ballots.
https://developer.ibm.com/patterns/how-to-create-a-secure-e-voting-application-on-hyperledger-fabric/
Apache License 2.0
324 stars 165 forks source link

Runtime NPM Issue #31

Closed akshatbahety closed 4 years ago

akshatbahety commented 4 years ago

I haven't been able to run the projcect locally I install NPM but whenever I start npm it shows the following error

C:\Users\akshat\evote\web-app\server>npm install
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN server@1.0.0 No license field.

audited 2359 packages in 42.46s
found 18 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details

C:\Users\akshat\evote\web-app\server>npm start

> server@1.0.0 start C:\Users\akshat\evote\web-app\server
> ./node_modules/nodemon/bin/nodemon.js src/app.js

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 start: `./node_modules/nodemon/bin/nodemon.js src/app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\akshat\AppData\Roaming\npm-cache\_logs\2020-04-07T11_45_12_000Z-debug.log

C:\Users\akshat\evote\web-app\server>

I haven't been able to figure out how to solve this issue. I tried to use NPM 8.9.0 and it brings up the same issue and more


C:\Users\akshat\evote\web-app\server>npm install
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN server@1.0.0 No license field.

npm ERR! path C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\abbrev
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\abbrev' -> 'C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\.abbrev.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\akshat\AppData\Roaming\npm-cache\_logs\2020-04-07T12_16_57_399Z-debug.log

So am I missing something

horeaporutiu commented 4 years ago

@akshatbahety

Try node app.js instead of npm start

let me know if that works. seems like npm start is for some reason putting a period in the command which is making it fail

akshatbahety commented 4 years ago

Still not working

C:\Users\akshat\evote\web-app\server>npm start

> server@1.0.0 start C:\Users\akshat\evote\web-app\server
> ./node_modules/nodemon/bin/nodemon.js src/app.js

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! server@1.0.0 start: `./node_modules/nodemon/bin/nodemon.js src/app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\akshat\AppData\Roaming\npm-cache\_logs\2020-04-09T16_53_42_528Z-debug.log

C:\Users\akshat\evote\web-app\server>node app.js
module.js:538
    throw err;
    ^

Error: Cannot find module 'C:\Users\akshat\evote\web-app\server\app.js'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

C:\Users\akshat\evote\web-app\server>C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin
'C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\akshat\evote\web-app\server>cd C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin

C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin>node app.js
module.js:538
    throw err;
    ^

Error: Cannot find module 'C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin\app.js'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3

C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin>node nodemon.js
  Usage: nodemon [nodemon options] [script.js] [args]

  See "nodemon --help" for more.

C:\Users\akshat\evote\web-app\server\node_modules\nodemon\bin>/node_modules/nodemon/bin/nodemon.js src/app.js
The system cannot find the path specified.
horeaporutiu commented 4 years ago

@akshatbahety run node app.js from the src directory

https://github.com/IBM/evote/tree/master/web-app/server/src

akshatbahety commented 4 years ago

C:\Users\akshat\evote\web-app\server\src>node app.js
module.js:538
    throw err;
    ^

Error: Cannot find module 'node-pre-gyp/lib/pre-binding'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Module.require (module.js:579:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\akshat\evote\web-app\server\node_modules\grpc\src\grpc_extension.js:26:14)
    at Module._compile (module.js:635:30)
    at Object.Module._extensions..js (module.js:646:10)
    at Module.load (module.js:554:32)
    at tryModuleLoad (module.js:497:12)
    at Function.Module._load (module.js:489:3)

Hey thanks for helping me out I think I am missing some module

akshatbahety commented 4 years ago

Tried to install all modules

C:\Users\akshat\evote\web-app\server\src>npm install node-pre-gyp
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN server@1.0.0 No license field.

npm ERR! path C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\abbrev
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\abbrev' -> 'C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\.abbrev.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\akshat\AppData\Roaming\npm-cache\_logs\2020-04-09T17_45_06_284Z-debug.log

C:\Users\akshat\evote\web-app\server\src>npm install acorn
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN server@1.0.0 No description
npm WARN server@1.0.0 No repository field.
npm WARN server@1.0.0 No license field.

npm ERR! path C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\abbrev
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\abbrev' -> 'C:\Users\akshat\evote\web-app\server\node_modules\grpc\node_modules\.abbrev.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\akshat\AppData\Roaming\npm-cache\_logs\2020-04-09T17_45_57_220Z-debug.log

C:\Users\akshat\evote\web-app\server\src>
horeaporutiu commented 4 years ago

https://github.com/IBM/evote#step-6-run-the-application

As shown in the step above - you must run npm install from the server directory. You are in the src dir.

horeaporutiu commented 4 years ago

what node version are you using? @akshatbahety

You can check by doing node -v

horeaporutiu commented 4 years ago

@akshatbahety note that this has been tested on node 8.9.0 so you should use that version

akshatbahety commented 4 years ago

Yes I am on the same version , sorted a lot of stuff thanks a lot

hitting this when I do node app.js

Error: Cannot find module 'node-pre-gyp/lib/pre-binding'

except this tried installing node-pre-gyp using

npm install node-pre-gyp -g
akshatbahety commented 4 years ago

okay sorted that too one last thing now when I am running

H:\evote\web-app\server\src>node app.js 

I have let it run for around 15 minutes no output was returned ended the operation and started the again still nothing.

akshatbahety commented 4 years ago

I'll assume the server is running and try to run the client.

akshatbahety commented 4 years ago

Hey it's running needed to relocate the files to src folder both fabric_connection.json and config

thanks a lot for helping out :)

vhiroley commented 4 years ago

npm ERR! missing script: start

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2020-04-13T08_36_44_541Z-debug.log

isko kaise fix karenge...