• Najnowsze pytania
  • Bez odpowiedzi
  • Zadaj pytanie
  • Kategorie
  • Tagi
  • Zdobyte punkty
  • Ekipa ninja
  • IRC
  • FAQ
  • Regulamin
  • Książki warte uwagi

Error: Cannot find module 'domelementtype'

Object Storage Arubacloud
0 głosów
336 wizyt
pytanie zadane 10 grudnia 2016 w JavaScript przez Kamil Ścibor Nowicjusz (200 p.)
edycja 10 grudnia 2016 przez ScriptyChris

Witam! Mam taki problem otóż próbuje zrobić swojego jackpota do gry cs:go. Ale po wpisaniu komendy w putty (komenda: node bot1.js) która powinna uruchomić bota wyskakuję mi error. A dokładnie: 

Error: Cannot find module 'domelementtype'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/var/www/node_modules/steam-tradeoffer-manager/node_modules/steamcommunity/node_modules/cheerio/node_modules/css-select/node_modules/domutils/lib/stringify.js:1:81)
    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)

I takie pytanie co to ten "domelemttype" ? 

3 odpowiedzi

0 głosów
odpowiedź 10 grudnia 2016 przez ShiroUmizake Nałogowiec (46,300 p.)
Czy kod został bundlowany? Czy serwer posiada npm,node.JS, babel (jeśli używasz) czy wskazany katalog kodu żródłowego jest poprawnie wskazywany w (webpack_config.js, jeżeli używasz webpack). Po czwarte poprosimy kod :).
0 głosów
odpowiedź 10 grudnia 2016 przez Kamil Ścibor Nowicjusz (200 p.)

Kod całego bot1.js:

 

var Steam = require('steam');
var SteamUser = require('steam-user');
var TradeOfferManager = require('steam-tradeoffer-manager');
var SteamTotp = require('steam-totp');
var TOTP = require('onceler').TOTP;
var request = require('request');
var SteamCommunity = require('steamcommunity');
var community = new SteamCommunity();
var fs = require('node-fs');

// GENERAL INFORMATION	
var sitepath;
sitepath = "csgotop.pl/index.php"; // The path to the index.php of your website without HTTP://
var sitename;
sitename = "CSGOTop"; // The name of your site, it will be shown in the Trade Offer Message

var apik = ""; // Must be the API Key associated with the current bot. Get it here: https://steamcommunity.com/dev/apikey
var admin = 'STEAM_0:0:136453542'; // The Admin, Main Owner of the site. You will be able to communicate with the bot, ask for the rake items, etc
var botsteamid = '76561198233172812'; // The bot's steam id, it is required to generate the Device ID and to confirm mobile confirmations
var identitysecret = ''; // It's required to confirm mobile confirmations
var sharedsecret = ''; // You won't be able to log in without this code
var polling_interval  = 10000; // 10 seconds by default, the bot checks for outgoing confirmations every X seconds, defined here
var rsecret=''; // Also change this to the same code in endround.php and p2endround.php, this prevents people from randomly breaking your site by ending blank games or ending games sooner
var snipetimer=5; // Declines offers sent in the last few seconds

var GameTime = 120; // This is how long a round lasts, you need to edit in a couple of other places too if you want to truly change it without any bugs

var p2=false; // If this is the bot for your Jackpot 2 set this to true

var playersRequired=2; // The timer will start when this many players are in the pot
// GENERAL INFORMATION

// LOGIN DETAILS
var details = {
	"accountName"   : "",
	"password"      : "",
	"twoFactorCode" : SteamTotp.generateAuthCode(sharedsecret)
};
// LOGIN DETAILS

var client = new SteamUser();
var manager = new TradeOfferManager({
    "steam"    : client,
    "domain"   : "csgotop.pl",
    "language" : "en"
})

// MYSQL INFO
var mysql = require('mysql');
var sql_host="localhost";
var sql_user="root";
var sql_password="";
var sql_database="cs";
var custommysql=0; // If you want to create a different kind of MYSQL connection simply set this to 1 and code your own connection below.
// MYSQL INFO


// Game Information
var appid=730; // Steam Game APPID | CSGO: 730 - DOTA2: 570 - TF2: 440 - H1Z1: 295110
var appname='CSGO'; // Name of the Game this bot is for, it's needed for the messages
// Game Information


// PRICING API
var prices;
function loadprices() // The default pricing API the bot uses, only gets the value of CSGO skins
{
    request('https://api.csgofast.com/price/all', function(error, response, body)
	{
        prices = JSON.parse(body);
        if(response.statusCode != 200)
		{
            if(fs.existsSync(__dirname + '/prices.txt'))
			{
                prices = JSON.parse(fs.readFileSync(__dirname + '/prices.txt'));
                console.log('[SERVER] Loading Prices - Server sided prices loaded!');
            }
        }
		else
		{
            fs.writeFileSync('prices.txt', body);
            console.log('[SERVER] Loading Prices - API prices loaded!');
        }
    });	
}
setInterval(function(){loadprices();},3600000);
loadprices();

function GetPrice(skin) // This function gets the value of the skins, you can change it if you'd like to use a custom api. ,,skin" is the full name + quality of the given skin, example.: AK-47 | Redline (Field-Tested)
{
	var price=prices[skin];
	return price;
}
0 głosów
odpowiedź 10 grudnia 2016 przez Kamil Ścibor Nowicjusz (200 p.)
Nie jest on cały ze względu na limit.

Podobne pytania

0 głosów
1 odpowiedź 772 wizyt
pytanie zadane 6 marca 2021 w HTML i CSS przez Trekeren Początkujący (370 p.)
0 głosów
3 odpowiedzi 441 wizyt
pytanie zadane 12 kwietnia 2018 w JavaScript przez MrHerman Nowicjusz (210 p.)

92,538 zapytań

141,377 odpowiedzi

319,456 komentarzy

61,923 pasjonatów

Motyw:

Akcja Pajacyk

Pajacyk od wielu lat dożywia dzieci. Pomóż klikając w zielony brzuszek na stronie. Dziękujemy! ♡

Oto polecana książka warta uwagi.
Pełną listę książek znajdziesz tutaj.

Akademia Sekuraka

Kolejna edycja największej imprezy hakerskiej w Polsce, czyli Mega Sekurak Hacking Party odbędzie się już 20 maja 2024r. Z tej okazji mamy dla Was kod: pasjamshp - jeżeli wpiszecie go w koszyku, to wówczas otrzymacie 40% zniżki na bilet w wersji standard!

Więcej informacji na temat imprezy znajdziecie tutaj. Dziękujemy ekipie Sekuraka za taką fajną zniżkę dla wszystkich Pasjonatów!

Akademia Sekuraka

Niedawno wystartował dodruk tej świetnej, rozchwytywanej książki (około 940 stron). Mamy dla Was kod: pasja (wpiszcie go w koszyku), dzięki któremu otrzymujemy 10% zniżki - dziękujemy zaprzyjaźnionej ekipie Sekuraka za taki bonus dla Pasjonatów! Książka to pierwszy tom z serii o ITsec, który łagodnie wprowadzi w świat bezpieczeństwa IT każdą osobę - warto, polecamy!

...