Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
j86 opened this issue Feb 29, 2016 · 4 comments
Open

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

j86 opened this issue Feb 29, 2016 · 4 comments

Comments

@j86
Copy link

j86 commented Feb 29, 2016

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

Is there something I'm missing here?

@j86
Copy link
Author

j86 commented Feb 29, 2016

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
Copy link
Owner

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
Copy link

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants