Skip to content

Error trying to import deriv-api  #21

Description

@guilhermelionzo

Hi there,

I'm trying to import deriv-api, but I'm receving the following error message:

> binarybot@1.0.0 start C:\Users\User\vscode-workspace\binarybot
> node index.js

file:///C:/Users/User/vscode-workspace/binarybot/index.js:4
import DerivAPI from '@deriv/deriv-api';
       ^^^^^^^^
SyntaxError: The requested module '@deriv/deriv-api' does not provide an export named 'default'
    at ModuleJob._instantiate (internal/modules/esm/module_job.js:92:21)
    at async ModuleJob.run (internal/modules/esm/module_job.js:107:20)
    at async Loader.import (internal/modules/esm/loader.js:179:24)

I ran the code below using NodeJs v14.0.0 and v13.5.

Could you guys help me?

import express from 'express';
import cors from 'cors';
import routes from './routes.js';
import DerivAPI from '@deriv/deriv-api';

var app = express();
var router = express.Router()

app.use(cors());
app.use(express.json());

router.get('/', function (req, res) {
    res.send('ROOT FOLDER')
  })

app.use(routes);
app.listen(3333, () => {
    console.log('debug > console listening on port 3333');
});

If you guys need more information, please, let me know.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions