-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: Cannot read property 'replace' of undefined #13
Comments
I don't think there is a problem with the modules. My guess is that the Maybe try to remove the cookie jar and run again? |
I removed the cookie jar, and completely reinstalled script in another directory. Still dont work for me.
|
Are you familiar with Node and able to add some debug statements? I would try to |
Here it is, line 135-136 of index.js with parseInteger function. What i need to do with it?
|
First, try something like this: /**
* Parse a string to an integer, including stripping the 'per mille' sign (,) and the dollar sign ($).
* @param {string} input - The input to be parsed to an integer.
* @returns {number} - The parsed integer.
*/
function parseInteger(input) {
console.log(input);
return parseInt(input.replace(/[\$,]/g, '').trim());
} |
TypeError: Cannot read property 'replace' of undefined |
Can you log into Socialclub, open this URL in your browser and give me the full output? (Right click, show source, paste here) |
root@playplanet:/home/mo45/scp# node index.js Mo45UA
Checking for existing cookies and verification token
Existing cookies and verification token found
Send GET-request to: http://socialclub.rockstargames.com/games/gtav/career/overviewAjax?character=Freemode&nickname=Mo45UA&slot=Freemode&gamerHandle=&gamerTag=&_=1485856587832
/home/mo45/scp/index.js:136
return parseInt(input.replace(/[$,]/g, '').trim());
^
TypeError: Cannot read property 'replace' of undefined
at parseInteger (/home/mo45/scp/index.js:136:26)
at Request._callback (/home/mo45/scp/index.js:428:29)
at Request.self.callback (/home/mo45/scp/node_modules/request/request.js:186:22)
at emitTwo (events.js:106:13)
at Request.emit (events.js:191:7)
at Request. (/home/mo45/scp/node_modules/request/request.js:1081:10)
at emitOne (events.js:96:13)
at Request.emit (events.js:188:7)
at Gunzip. (/home/mo45/scp/node_modules/request/request.js:1001:12)
at Gunzip.g (events.js:291:16)
Node version 6.9.2
When trying to npm install get this:
npm WARN [email protected] No repository field.
After that i install required modules by myself. but still have same error.
The text was updated successfully, but these errors were encountered: