betfair icon indicating copy to clipboard operation
betfair copied to clipboard

Paths in index.js not correct

Open PaulGrimshaw opened this issue 9 years ago • 4 comments

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/'

PaulGrimshaw avatar Nov 24 '15 21:11 PaulGrimshaw

+1

AlexanderTserkovniy avatar Jan 22 '16 14:01 AlexanderTserkovniy

npm run build compiles src intgo lib

AlgoTrader avatar Jan 25 '16 08:01 AlgoTrader

I am getting this exception:

> [email protected] build /containers/adapters/BetFair/node_modules/betfair
> npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"


> [email protected] 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! [email protected] build-src: `babel src/lib --out-dir ./lib`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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! [email protected] 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 [email protected] 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 [email protected]
3 info using [email protected]
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle [email protected]~prebuild: [email protected]
6 silly lifecycle [email protected]~prebuild: no script for prebuild, continuing
7 info lifecycle [email protected]~build: [email protected]
8 verbose lifecycle [email protected]~build: unsafe-perm in lifecycle true
9 verbose lifecycle [email protected]~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 [email protected]~build: CWD: /containers/adapters/BetFair/node_modules/betfair
11 silly lifecycle [email protected]~build: Args: [ '-c',
11 silly lifecycle   'npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"' ]
12 silly lifecycle [email protected]~build: Returned: code: 1  signal: null
13 info lifecycle [email protected]~build: Failed to exec build script
14 verbose stack Error: [email protected] 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 [email protected]
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 [email protected] build: `npm run build-src && npm run build-test "compiles" "src" "intgo" "lib"`
22 error Exit status 1
23 error Failed at the [email protected] 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 avatar Jan 25 '16 08:01 AlexanderTserkovniy

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.

AlexanderTserkovniy avatar Jan 25 '16 08:01 AlexanderTserkovniy