Skip to content
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

Object has no method 'trunc' #37

Closed
jwiebalk opened this issue Jul 14, 2016 · 3 comments
Closed

Object has no method 'trunc' #37

jwiebalk opened this issue Jul 14, 2016 · 3 comments

Comments

@jwiebalk
Copy link

Happening on both my Centos7.2 and raspberry pi 2 systems.

/usr/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:95
NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.' + Math.trunc(Math
                                                                    ^
TypeError: Object #<Object> has no method 'trunc'
    at getHttp (/usr/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:95:158)
    at getXML (/usr/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:234:3)
    at speedTest (/usr/lib/node_modules/speed-test/node_modules/speedtest-net/index.js:492:3)
    at Object.<anonymous> (/usr/lib/node_modules/speed-test/cli.js:83:10)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
@jwiebalk
Copy link
Author

Dropping Math.trunc allowed this to proceed:

options.headers['user-agent'] = options.headers['user-agent'] || 'Mozilla/5.0 (Windows NT 6.3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.' + Math.random()*400 + 2704 + '.' + Math.random()*400 + 103 + ' Safari/537.36';

@skadimoolam
Copy link

This is also true in Windows 64

@SamVerschueren
Copy link
Contributor

After some testing, I noticed that Math.trunc requires Node.js 0.12+. I suggest upgrading your node version because 0.10will not be maintained after the 1st of October 2016.

https://github.com/nodejs/LTS#lts_schedule

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants