Ariel H.
Ariel H.

Reputation: 1116

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.

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

import * as jira from "https://deno.land/x/[email protected]/src/index.ts";


const client = new Version2Client({
  host: 'https://FFFFFF.atlassian.net',
  authentication: {
    basic: {
      email: '[email protected]',
      apiToken: 'FFFFFFFF',
    },
  },
});


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

  console.log(projects);
}

main();

Upvotes: 0

Views: 146

Answers (1)

Marcos Casagrande
Marcos Casagrande

Reputation: 40414

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: '[email protected]',
      apiToken: 'FFFFFFFF',
    },
  },
});

// ...

Upvotes: 2

Related Questions