coinbase / coinbase-pro-trading-toolkit

DEPRECATED — The Coinbase Pro trading toolkit
Apache License 2.0
870 stars 239 forks source link

t002_liveOrderbook.ts SyntaxError: Unexpected token * #261

Closed CyborgDroid closed 4 years ago

CyborgDroid commented 5 years ago

When trying to run the tutorial script

https://github.com/coinbase/coinbase-pro-trading-toolkit/blob/master/tutorials/t002_liveOrderbook.ts

I get the following error message at the first import statement:

(function (exports, require, module, __filename, __dirname) { import * as CBPTT from 'coinbase-pro-trading-toolkit';
                                                                     ^

SyntaxError: Unexpected token *
    at new Script (vm.js:80:7)
    at createScript (vm.js:274:10)
    at Object.runInThisContext (vm.js:326:10)
    at Module._compile (internal/modules/cjs/loader.js:664:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)

To install I ran:

npm install coinbase-pro-trading-toolkit
npm install -g typescript

I tried with both node v10.15.3 and v12.2.0 and get the same error. Thanks in advance for your help!

welanco commented 5 years ago

I got the same error. You have to copy the file to your project folder. Then it works.

Best regards André

drewrothstein commented 4 years ago

Hi, we are closing out PRs + Issues as this project is being archived.