This is a migrated thread and some comments may be shown as answers.

Could not find module 'https'

0 Answers 38 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Manuele
Top achievements
Rank 1
Manuele asked on 22 May 2017, 08:42 AM

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)

 

Tags
General Discussions
Asked by
Manuele
Top achievements
Rank 1
Share this question
or