Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Deno keeps giving me the same type of error on different modules

I am trying to connect with the Jira REST api using Deno. My Library of choice is Jira.js. I’ve used both installing the node_modules locally and referencing the modules through the library link. To no avail, deno gives me the same type of error.

error

This is my code.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

//import { Version2Client } from "./node_modules/jira.js/src/index.ts";

import * as jira from "https://deno.land/x/jira@v2.10.4/src/index.ts";


const client = new Version2Client({
  host: 'https://FFFFFF.atlassian.net',
  authentication: {
    basic: {
      email: 'FFFFFFF@gmail.com',
      apiToken: 'FFFFFFFF',
    },
  },
});


async function main() {
  const projects = await client.projects.getAllProjects();

  console.log(projects);
}

main();

>Solution :

jira.js does not support Deno directly. But you can run it with NPM compatibility mode, for that, you’ll need to replace your import to use npm: specifier: npm:jira.js

import { Version2Client } from 'npm:jira.js';

const client = new Version2Client({
  host: 'https://FFFFFF.atlassian.net',
  authentication: {
    basic: {
      email: 'FFFFFFF@gmail.com',
      apiToken: 'FFFFFFFF',
    },
  },
});

// ...
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading