qzhou1607-zz / stock-watcher-fcc

This application allows users to enter stock code which will then display a graph of that stocks price over time.
https://watch-your-stock.herokuapp.com/
0 stars 1 forks source link

Not able to start it #1

Open ernesst opened 7 years ago

ernesst commented 7 years ago

First of all thanks for the work, seems interesting.

After performing a npm install the npm start gives as results

/project/html-app/enclose/stock-watcher-fcc$ npm start

> stock-watcher@0.0.0 start /home/ernest/project/html-app/enclose/stock-watcher-fcc
> node server.js

{ Error: ENOENT: no such file or directory, open '.env'
    at Error (native)
    at Object.fs.openSync (fs.js:641:18)
    at Object.fs.readFileSync (fs.js:509:33)
    at Object.config (/home/ernest/project/html-app/enclose/stock-watcher-fcc/node_modules/dotenv/lib/main.js:30:37)
    at Object.<anonymous> (/home/ernest/project/html-app/enclose/stock-watcher-fcc/server.js:10:19)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:389:7)
    at startup (bootstrap_node.js:149:9)
    at bootstrap_node.js:504:3 errno: -2, code: 'ENOENT', syscall: 'open', path: '.env' }
(node:21937) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`

events.js:160
      throw er; // Unhandled 'error' event
      ^
MongoError: failed to connect to server [undefined:27017] on first connect [MongoError: getaddrinfo ENOTFOUND undefined undefined:27017]
    at Pool.<anonymous> (/home/ernest/project/html-app/enclose/stock-watcher-fcc/node_modules/mongodb-core/lib/topologies/server.js:328:35)
    at emitOne (events.js:96:13)
    at Pool.emit (events.js:188:7)
    at Connection.<anonymous> (/home/ernest/project/html-app/enclose/stock-watcher-fcc/node_modules/mongodb-core/lib/connection/pool.js:280:12)
    at Connection.g (events.js:292:16)
    at emitTwo (events.js:106:13)
    at Connection.emit (events.js:191:7)
    at Socket.<anonymous> (/home/ernest/project/html-app/enclose/stock-watcher-fcc/node_modules/mongodb-core/lib/connection/connection.js:177:49)
    at Socket.g (events.js:292:16)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at connectErrorNT (net.js:1021:8)
    at _combinedTickCallback (internal/process/next_tick.js:80:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)

npm ERR! Linux 4.4.0-73-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "start"
npm ERR! node v6.11.0
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE
npm ERR! stock-watcher@0.0.0 start: `node server.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the stock-watcher@0.0.0 start script 'node server.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the stock-watcher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node server.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs stock-watcher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls stock-watcher
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ernest/project/html-app/enclose/stock-watcher-fcc/npm-debug.log

Any idea ?

I'm on ubuntu 16.04 lts & node v6.11.0 Thanks

qzhou1607-zz commented 7 years ago

@ernesst Thank you for your interest in my side project. It looks like it's caused by the missing .env file. If you've not already done it, make sure to create your own .env file with your Quandl api and MongoDB credentials and save it in the root folder. See README.md for details. Also these credentials shouldn't be committed so .env is listed in .gitignore.

ernesst commented 7 years ago

Thanks, for the clarification.

It will not fit with my need, i wanted to wrap in a container your app to create a Stock app for Ubuntu Touch. However I cannot sort it out the mongodb. Thanks !!!

qzhou1607-zz commented 7 years ago

@ernesst Not sure if this will help, I'm not very familiar with Ubuntu. But here is the doc about mongodb on Ubuntu.

ernesst commented 7 years ago

Thanks for your feedback, Ubuntu touch doesn't allow service in background unfortunately.