AlgoTrader / betfair

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

Paths in index.js not correct #13

Open PaulGrimshaw opened 8 years ago

PaulGrimshaw commented 8 years ago

I may be missing something, but to get this library working I needed to change the paths in index.js to:

var BetfairSession = require('./src/lib/betfair_session');
exports.newSession = function (appKey, options) {
    return new BetfairSession(appKey, options);
};

// Export BetfairPrice
// Used to "normalize" prices to Betfair allowed values
var BetfairPrice = require('./src/lib/betfair_price');
exports.newBetfairPrice = function (price) {
    return new BetfairPrice(price);
}

I added the '/src/'

AlexanderTserkovniy commented 8 years ago

+1

AlgoTrader commented 8 years ago

npm run build compiles src intgo lib

AlexanderTserkovniy commented 8 years ago

I am getting this exception:

> betfair@0.5.1 build /containers/adapters/BetFair/node_modules/betfair
> npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"

> betfair@0.5.1 build-src /containers/adapters/BetFair/node_modules/betfair
> babel src/lib --out-dir ./lib

The CLI has been moved into the package `babel-cli`. See http://babeljs.io/docs/usage/cli/

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build-src"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! betfair@0.5.1 build-src: `babel src/lib --out-dir ./lib`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the betfair@0.5.1 build-src script 'babel src/lib --out-dir ./lib'.
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 betfair package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     babel src/lib --out-dir ./lib
npm ERR! You can get their info via:
npm ERR!     npm owner ls betfair
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /containers/adapters/BetFair/node_modules/betfair/npm-debug.log

npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "compiles" "src" "intgo" "lib"
npm ERR! node v5.4.1
npm ERR! npm  v3.3.12
npm ERR! code ELIFECYCLE
npm ERR! betfair@0.5.1 build: `npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the betfair@0.5.1 build script 'npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"'.
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 betfair package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"
npm ERR! You can get their info via:
npm ERR!     npm owner ls betfair
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /containers/adapters/BetFair/node_modules/betfair/npm-debug.log
Oleksandrs-MacBook-Pro-2:betfair Oleksandr$ node -v
v5.4.1

And also here is npm-debug.log file.

0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'run',
1 verbose cli   'build',
1 verbose cli   'compiles',
1 verbose cli   'src',
1 verbose cli   'intgo',
1 verbose cli   'lib' ]
2 info using npm@3.3.12
3 info using node@v5.4.1
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle betfair@0.5.1~prebuild: betfair@0.5.1
6 silly lifecycle betfair@0.5.1~prebuild: no script for prebuild, continuing
7 info lifecycle betfair@0.5.1~build: betfair@0.5.1
8 verbose lifecycle betfair@0.5.1~build: unsafe-perm in lifecycle true
9 verbose lifecycle betfair@0.5.1~build: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/containers/adapters/BetFair/node_modules/betfair/node_modules/.bin:/containers/adapters/BetFair/node_modules/.bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
10 verbose lifecycle betfair@0.5.1~build: CWD: /containers/adapters/BetFair/node_modules/betfair
11 silly lifecycle betfair@0.5.1~build: Args: [ '-c',
11 silly lifecycle   'npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"' ]
12 silly lifecycle betfair@0.5.1~build: Returned: code: 1  signal: null
13 info lifecycle betfair@0.5.1~build: Failed to exec build script
14 verbose stack Error: betfair@0.5.1 build: `npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"`
14 verbose stack Exit status 1
14 verbose stack     at EventEmitter.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:232:16)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at EventEmitter.emit (events.js:172:7)
14 verbose stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14)
14 verbose stack     at emitTwo (events.js:87:13)
14 verbose stack     at ChildProcess.emit (events.js:172:7)
14 verbose stack     at maybeClose (internal/child_process.js:821:16)
14 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
15 verbose pkgid betfair@0.5.1
16 verbose cwd /containers/adapters/BetFair/node_modules/betfair
17 error Darwin 15.3.0
18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" "compiles" "src" "intgo" "lib"
19 error node v5.4.1
20 error npm  v3.3.12
21 error code ELIFECYCLE
22 error betfair@0.5.1 build: `npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"`
22 error Exit status 1
23 error Failed at the betfair@0.5.1 build script 'npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"'.
23 error Make sure you have the latest version of node.js and npm installed.
23 error If you do, this is most likely a problem with the betfair package,
23 error not with npm itself.
23 error Tell the author that this fails on your system:
23 error     npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"
23 error You can get their info via:
23 error     npm owner ls betfair
23 error There is likely additional logging output above.
24 verbose exit [ 1, true ]
AlexanderTserkovniy commented 8 years ago

It would be perfect and much easier to consumers if you lead the best practice to publish the package, which works out of the box.