BillionzB
Denoβ€’3y agoβ€’
10 replies
Billionz

NPM CCXT Not Working

I'm trying to run the NPM Package CCXT and I'm getting an "ERR_MODULE_NOT_FOUND" error any help in resolving would be much appreciated.

TypeError: Could not resolve 'debug' from 'file:///Users/xxx/Library/Caches/deno/npm/registry.npmjs.org/ccxt/4.1.75/js/src/static_dependencies/proxies/http-proxy-agent/index.js'.

import ccxt, { Exchange, Order } from 'npm:ccxt'
export const ccxtpro = ccxt.pro

const bybit = new ccxtpro.bybit({
  enableRateLimit: false,
  options: { defaultType: 'swap' },
})

for (let index = 0; index < 5; index++) {
  try {
    console.log('fetch data ')
    console.time('Fetch Ticker ' + index)
    const ticker = await bybit.fetchTicker('BTC/USDT:USDT')
    console.timeEnd('Fetch Ticker ' + index)
    logger.info(index + ' ' + ticker.last)
  } catch (error) {
    console.log(error)
  }
}
Was this page helpful?