Linux / Node.js Error by Require

Asked

Viewed 71 times

1

I got this error when I ran the file "Typeerror: Cannot read Property 'require' of Undefined"

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

Where could I be wrong?... Confused... The so-called payment.js is in the same folder as this file.

  • then remove ./....of the path

  • No hiccup yet....

2 answers

0

I’ve had exactly the same problem as you, and I’ve solved it by removing the ' ./ ':

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

  • did not work, the problem is the same.

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 and 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 = [];

Browser other questions tagged

You are not signed in. Login or sign up in order to post.