DavideVi / DCSCPP

DCSC Poker Planning
0 stars 0 forks source link

How to run this? #8

Open kramos opened 7 years ago

kramos commented 7 years ago

I tried:

  1. Git clone this repo and cd into the folder
  2. $ npm install
  3. $ npm start

No luck, start is looking for a bin directory.

$ npm start

> planningpoker@0.0.0 start C:\Users\mark.rendell\adop\DCSCPP
> node ./bin/www

module.js:328
    throw err;
    ^

I also tried: node app.js No luck:

$ node app.js
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
js-bson: Failed to load c++ bson extension, using pure JS version
kramos commented 7 years ago

On the off chance I tried deploying to heroku.

heroku create ppoker123
heroku addons:create mongolab:sandbox
git push heroku HEAD:master

It detected a node app and build ok:

-----> Node.js app detected
-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version 6.x via semver.io...
       Downloading and installing node 6.9.5...
       Using default npm version: 3.10.10
-----> Restoring cache
       Skipping cache restore (new runtime signature)
-----> Building dependencies
       Installing node modules (package.json)

       > bson@0.2.22 install /tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23/node_modules/bson
       > (node-gyp rebuild 2> builderror.log) || (exit 0)

       make: Entering directory `/tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23/node_modules/bson/build'
       CXX(target) Release/obj.target/bson/ext/bson.o
       make: Leaving directory `/tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23/node_modules/bson/build'

       > kerberos@0.0.11 install /tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23/node_modules/kerberos
       > (node-gyp rebuild 2> builderror.log) || (exit 0)

       make: Entering directory `/tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23/node_modules/kerberos/build'
       CXX(target) Release/obj.target/kerberos/lib/kerberos.o
       make: Leaving directory `/tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23/node_modules/kerberos/build'
       planningpoker@0.0.0 /tmp/build_314b68b9bb9941a6f8acf72a1bc1bf23
       ├─┬ body-parser@1.15.2
       │ ├── bytes@2.4.0
       │ ├── content-type@1.0.2
       │ ├── depd@1.1.0
       │ ├─┬ http-errors@1.5.1
       │ │ ├── inherits@2.0.3
       │ │ ├── setprototypeof@1.0.2
       │ │ └── statuses@1.3.1
       │ ├── iconv-lite@0.4.13
       │ ├─┬ on-finished@2.3.0
       │ │ └── ee-first@1.1.1
       │ ├── qs@6.2.0
       │ ├─┬ raw-body@2.1.7
       │ │ └── unpipe@1.0.0
       │ └─┬ type-is@1.6.14
       │   ├── media-typer@0.3.0
       │   └─┬ mime-types@2.1.14
       │     └── mime-db@1.26.0
       ├─┬ cookie-parser@1.4.3
       │ ├── cookie@0.3.1
       │ └── cookie-signature@1.0.6
       ├─┬ debug@2.2.0
       │ └── ms@0.7.1
       ├─┬ express@4.14.1
       │ ├─┬ accepts@1.3.3
       │ │ └── negotiator@0.6.1
       │ ├── array-flatten@1.1.1
       │ ├── content-disposition@0.5.2
       │ ├── encodeurl@1.0.1
       │ ├── escape-html@1.0.3
       │ ├── etag@1.7.0
       │ ├── finalhandler@0.5.1
       │ ├── fresh@0.3.0
       │ ├── merge-descriptors@1.0.1
       │ ├── methods@1.1.2
       │ ├── parseurl@1.3.1
       │ ├── path-to-regexp@0.1.7
       │ ├─┬ proxy-addr@1.1.3
       │ │ ├── forwarded@0.1.0
       │ │ └── ipaddr.js@1.2.0
       │ ├── range-parser@1.2.0
       │ ├─┬ send@0.14.2
       │ │ ├── destroy@1.0.4
       │ │ ├── mime@1.3.4
       │ │ └── ms@0.7.2
       │ ├── serve-static@1.11.2
       │ ├── utils-merge@1.0.0
       │ └── vary@1.1.0
       ├─┬ jade@1.11.0
       │ ├── character-parser@1.2.1
       │ ├─┬ clean-css@3.4.24
       │ │ ├─┬ commander@2.8.1
       │ │ │ └── graceful-readlink@1.0.1
       │ │ └─┬ source-map@0.4.4
       │ │   └── amdefine@1.0.1
       │ ├── commander@2.6.0
       │ ├─┬ constantinople@3.0.2
       │ │ └── acorn@2.7.0
       │ ├─┬ jstransformer@0.0.2
       │ │ ├── is-promise@2.1.0
       │ │ └─┬ promise@6.1.0
       │ │   └── asap@1.0.0
       │ ├─┬ mkdirp@0.5.1
       │ │ └── minimist@0.0.8
       │ ├─┬ transformers@2.1.0
       │ │ ├─┬ css@1.0.8
       │ │ │ ├── css-parse@1.0.4
       │ │ │ └── css-stringify@1.0.5
       │ │ ├─┬ promise@2.0.0
       │ │ │ └── is-promise@1.0.1
       │ │ └─┬ uglify-js@2.2.5
       │ │   ├─┬ optimist@0.3.7
       │ │   │ └── wordwrap@0.0.3
       │ │   └── source-map@0.1.43
       │ ├─┬ uglify-js@2.7.5
       │ │ ├── async@0.2.10
       │ │ ├── source-map@0.5.6
       │ │ ├── uglify-to-browserify@1.0.2
       │ │ └─┬ yargs@3.10.0
       │ │   ├── camelcase@1.2.1
       │ │   ├─┬ cliui@2.1.0
       │ │   │ ├─┬ center-align@0.1.3
       │ │   │ │ ├─┬ align-text@0.1.4
       │ │   │ │ │ ├─┬ kind-of@3.1.0
       │ │   │ │ │ │ └── is-buffer@1.1.4
       │ │   │ │ │ ├── longest@1.0.1
       │ │   │ │ │ └── repeat-string@1.6.1
       │ │   │ │ └── lazy-cache@1.0.4
       │ │   │ ├── right-align@0.1.3
       │ │   │ └── wordwrap@0.0.2
       │ │   ├── decamelize@1.2.0
       │ │   └── window-size@0.1.0
       │ ├── void-elements@2.0.1
       │ └─┬ with@4.0.3
       │   ├── acorn@1.2.2
       │   └── acorn-globals@1.0.9
       ├─┬ mongodb@1.4.40
       │ ├─┬ bson@0.2.22
       │ │ └── nan@1.8.4
       │ ├── kerberos@0.0.11
       │ └─┬ readable-stream@2.2.2
       │   ├── buffer-shims@1.0.0
       │   ├── core-util-is@1.0.2
       │   ├── isarray@1.0.0
       │   ├── process-nextick-args@1.0.7
       │   ├── string_decoder@0.10.31
       │   └── util-deprecate@1.0.2
       ├─┬ monk@1.0.1
       │ ├── mongoskin@1.4.13
       │ └── mpromise@0.5.1
       ├─┬ morgan@1.7.0
       │ ├── basic-auth@1.0.4
       │ └── on-headers@1.0.1
       └─┬ serve-favicon@2.3.2
       └── ms@0.7.2

-----> Caching build
       Clearing previous node cache
       Saving 2 cacheDirectories (default):
       - node_modules
       - bower_components (nothing to cache)
-----> Build succeeded!
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 15.8M
-----> Launching...
       Released v4
       https://ppoker123.herokuapp.com/ deployed to Heroku

But immediately crashed on heroku:

2017-02-03T23:37:51.576973+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2017-02-03T23:37:51.577155+00:00 app[web.1]: npm ERR!     node ./bin/www
2017-02-03T23:37:51.577513+00:00 app[web.1]: npm ERR! You can get information on how to open an issue for this project with:
2017-02-03T23:37:51.577513+00:00 app[web.1]: npm ERR!     npm bugs planningpoker
2017-02-03T23:37:51.577645+00:00 app[web.1]: npm ERR! Or if that isn't available, you can get their info via:
2017-02-03T23:37:51.577790+00:00 app[web.1]: npm ERR!     npm owner ls planningpoker
2017-02-03T23:37:51.577945+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2017-02-03T23:37:51.582821+00:00 app[web.1]: 
2017-02-03T23:37:51.583096+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2017-02-03T23:37:51.583231+00:00 app[web.1]: npm ERR!     /app/npm-debug.log
2017-02-03T23:37:51.663066+00:00 heroku[web.1]: State changed from starting to crashed

I think heroku was trying to run:

npm start

(as per package json). So probably had the same problem I did.

DavideVi commented 7 years ago

It's missing the /bin folder as it was added to .gitignore.

  1. $ npm install -g express
  2. $ npm install -g express-generator
  3. $ express sample
  4. Git clone this repo and cd into the folder
  5. $ mv ../sample/bin .
  6. $ npm install
  7. $ npm start

Added /bin to .gitignore out of habit. Not sure if that's the recommended practice for Express projects.

kramos commented 7 years ago

Thanks that... plus this goofing around got the app up and running: http://stackoverflow.com/questions/28651028/cannot-find-module-build-release-bson-code-module-not-found-js-bson

Good question about the bin directory, I couldn't find a clear answer.

Anyway, I also got it running on Heroku: https://ppoker123.herokuapp.com

Had to make this change to app.js var db = monk(process.env.MONGODB_URI);

I'll stop the instance on heroku at some point and progrses with turning this into my safety check app :)

Thanks!