Could not find module 'https'

Thread is closed for posting
1 posts, 0 answers
  1. Manuele
    Manuele avatar
    1 posts
    Member since:
    May 2017

    Posted 22 May 2017 Link to this post

    Hi,

    in my NativeScript application I need the following Node module: https://github.com/malko/node-promised-redmine

    So I installed it (with npm install --save promised-redmine) and tried in the HelloWorld application. I putted the following snipped in my main-page.js:

    var Redmine = require('promised-redmine');
    var config = {
    host: "my.host.com", // required
    apiKey: "_mykey_", // required
    pathPrefix: "/",
    protocol: "http"
    };
    var redmineApi = new Redmine(config);
    redmineApi.getProjects().success(function (projects) {console.log(projects)});

    When I run the application I get the following error:

    file:///app/tns_modules/promised-redmine/./lib/redmine.js:4:19: JS ERROR Error: Could not find module 'https'.

    If I run the same code in an empty Node project it works without issues.

    Why it happens? The https module should be a core Node.js module (https://nodejs.org/api/https.html#https_https)

     

Back to Top