D
Deno

help

NPM CCXT Not Working

BBillionz12/4/2023
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)
}
}
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)
}
}
Mmarvinh.12/4/2023
Looking into the npm package it seems like they depend on the debug package but haven't listed that as a dependency inside their package.json This likely only works by accident even in node because another dependency might put debug into node_modules which this one relies on Would be worth filing a bug report in their tracker that they forgot to list the dependency in their package.json
BBillionz12/4/2023
thank you is there a way I can load it manaully as a hot fix in the interim
Mmarvinh.12/4/2023
I don't think so. deno expects the contents in package.json to be correct
BBillionz12/4/2023
Ok , thanks again
Mmarvinh.12/4/2023
maybe through esm.sh?
BBillionz12/4/2023
Would you be able to show me how to try that, still very new to deno
Mmarvinh.12/4/2023
Changing npm:ccxt to https://esm.sh/cctx should be enough to give that a go
BBillionz12/4/2023
Thank you, that worked great!!

Looking for more? Join the community!

Recommended Posts
How do you use a private docker hub image on AWS Lightsail?I'm following the guide here https://docs.deno.com/runtime/manual/advanced/deploying_deno/aws_lightsIs there a way to reset/flush my deno vk queues on deploy?Nothing seems to be queuing. I would like to reset it if possible?Return lazy struct fields from OpMy goal is to build a plugin system which allows invoking user defined code. One of the features I aRelative path in WebSocketWhy does relative path in `WebSocket` not work?Relative path in `npm:` specifierI have this in my import map: ``` "@heroicons/react/": "npm:@heroicons/react@2.0.18/" ``` And I try Transitive dependencies with node_modulesHi all, today I stumbled upon this not-sure-if-a-bug: ```ts import { LRParser } from "npm:@lezer/lrUpgraded to Fresh 1.60 but TailwindCSS not renderingI updated my codebase to Fresh 1.60 using TailwindCSS instead of twind. When I pushed the code to DeOptimize for Prod simple static vanilla JS script - WebServer App with Oak + DEJSUsing DEJS to render views. Those views are served by Oak, according to the defined routes. What is ReadableStream passed to an island component argument becomes an empty objectI am passing `ReadableStream` to an island component argument becomes an empty objectdeno.jsonc "unstable" format?I added this entry to my `deno.jsonc`: ```json "unstable": [ "broadcast-channel", "ffi", "fs"Signal value not updating from inside of `for await of` loop inside of an IIFE```ts // routes/connect.tsx import type { FunctionComponent } from 'preact' import type { PageProps Pricing Question - Is my pro account applied to my Orgs?Just recently purchased a pro account cause I thought a project would benefit from the extra firepowRecommended `denoland/deno` contributor editor setupI have a problem with deno trying to redefine itself via random `declare namespace Deno { ... }` thrHow to enable "WebSocketStream" using deno.json fileI want to enable "WebSocketStream" using deno.json's "unstable" array option.subhosting to run user scriptsI want to allow users to run arbitrary scripts, but they don't need to be available as endpoints, soRemove Old DeploymentsIs there a way to remove old preview deployments, or do they expire at some point? There are a numbeCompiled program cannot write to fileI made a program that can download the latest version of papermc or velocity. and it does download iHow to monkey patch an installed third party deno module.Is it possible to monkey patch an installed third party deno module?? I want to overwrite a functionMongoDB connection error on Deno DeployHello, I've a project running on Deno Deploy using Deno Fresh and I need to write information beinDeno cron instrumentationWe at Sentry are looking at adding automatic instrumentation for Deno crons: https://github.com/gets