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

brorand.Rand is not a constructor, throw (exception) error #10

Open
dipika21 opened this issue Sep 6, 2019 · 5 comments
Open

brorand.Rand is not a constructor, throw (exception) error #10

dipika21 opened this issue Sep 6, 2019 · 5 comments

Comments

@dipika21
Copy link

dipika21 commented Sep 6, 2019

npm version : 5.10.0
node version : 8.9.4
phantomjs version : 2.1.1 (binary created from source code)

Facing below issue on Power RHEL and X86 Ubuntu also while npm run test:

miller-rabin/node_modules/yargs/yargs.js:1163
else throw err
^
TypeError: brorand.Rand is not a constructor

miller-rabin

NOTE: Updated packages to latest version from package.json to solve errors while doing npm install.

@fanatid
Copy link

fanatid commented Sep 6, 2019

npm run test cause this?

@dipika21
Copy link
Author

dipika21 commented Sep 6, 2019

npm run test cause this?

yes
(my bad, edited )

@fanatid
Copy link

fanatid commented Sep 6, 2019

I just run this command with [email protected] on bda17a3 (v4.0.1) and everything work without errors.
Can you try create brorand.Rand outside test?

const { Rand } = require('brorand')
const r = new Rand()

@dipika21
Copy link
Author

dipika21 commented Sep 19, 2019

cloned again from repo,
updated below packages:
"mocha": "6.2.0"
"bn.js": "5.0.0",
to latest version to solve npm install deprecated error.
npm install : DONE
npm test facing error:
Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
so, added

"test": "mocha --timeout 10000" in package.json

npm test : DONE

Miller-Rabin
✓ should test number for primality (2713ms)
1 passing (3s)

@fanatid
Copy link

fanatid commented Sep 19, 2019

OK, my steps:

  • clone repo, HEAD is bda17a3
  • change bn.js => 5.0.0, mocha => 6.2.0
  • npm install
  • npm run test
> mocha --reporter=spec test/**/*-test.js


  Miller-Rabin
    ✓ should test number for primality (726ms)


  1 passing (729ms)

¯\_(ツ)_/¯

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

Successfully merging a pull request may close this issue.

2 participants