Linux / Node.js Require Error

1

I got this error when I ran the file "TypeError: Can not read property 'require' of undefined"

 var Main = Electron.remote.require('./payment.js');

Where can I be wrong? ... Confused ... The supposed payment.js is in the same folder as this file.

    
asked by anonymous 22.08.2017 / 14:03

2 answers

0
  

I've had exactly the same problem as you, and I've decided to remove the ./ ':

var Main = Electron.remote.require('payment.js');

    
22.08.2017 / 14:47
0
TypeError: Cannot read property 'require' of undefined
at Object.<anonymous> (C:\Users\Silva\Desktop\Steam-Card-Farmer-master\Steam-Card-Farmer-master\farmer.js:10:42)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
at run (bootstrap_node.js:389:7)
at startup (bootstrap_node.js:149:9)
at bootstrap_node.js:504:3

This is the code

var SteamUser = require('steam-user');
var Steam = SteamUser.Steam;
var request = require('request');
var Cheerio = require('cheerio');
var fs = require("fs");

var client = new SteamUser({"enablePicsCache": 
true,"promptSteamGuardCode":false});

var Electron = require('electron');

- > var Main = Electron.remote.require ('main.js');

var g_Jar = request.jar();
request = request.defaults({"jar": g_Jar});
var g_Page = 1;
var g_Start;
var g_CheckTimer;
var g_OwnedApps = [];
    
23.08.2017 / 04:35