AlgoTrader / betfair

Betfair API-NG library for node.js
96 stars 46 forks source link

Error: Cannot find module './lib/betfair_session' #21

Open j86 opened 8 years ago

j86 commented 8 years ago

Just installed betfair via node into my angular-fullstack. After trying to require betfair(var betfair = require('betfair'); ), I get this error:

Error: Cannot find module './lib/betfair_session' at Function.Module._resolveFilename (module.js:339:15) at Function.Module.load (module.js:290:25) at Module.require (module.js:367:17) at require (internal/module.js:16:19) at Object. (/var/www/html/**/_/node_modules/betfair/index.js:9:22) at Module._compile (module.js:413:34) at Module._extensions..js (module.js:422:10) at Object.require.extensions.(anonymous function) [as .js](/var/www/html/**//node_modules/babel-core/lib/api/register/node.js:214:7)

Is there something I'm missing here?

j86 commented 8 years ago

Variables in the index.js are pointing to the wrong source: var BetfairSession = require('./lib/betfair_session'); var BetfairPrice = require('./lib/betfair_price');

These two routes need the /src directory included in them:

var BetfairSession = require('./src/lib/betfair_session'); var BetfairPrice = require('./src/lib/betfair_price');

AlgoTrader commented 8 years ago

run 'npm run build' it compiles es6 from ./src to ./lib

PS the lib is in heavy rewrite now, now in modern JS and I also much improved my JS skills

ngBroken commented 8 years ago

It would be nice if the package came built, jus saying.... running build doesn't work for me, just going to hack your index.js for now

AlgoTrader commented 8 years ago

Yep. Currently, git repo is not stable so I do not publish it to npm. As soon as it is stable, I will do it