Meteor: random case ()

I get the following error when after installing my Meteor application (developed in the old version of Meteor) on Meteor version 1.2.0.1:

ReferenceError: Random is not defined

Line of violation:

Players.insert({name: names[i], score: Math.floor(Random.fraction()*10)*5});

I have never had a problem with this line of code before and according to docs this should work.

Any ideas?

+4
source share
2 answers

You need to install the package random, it is not installed by default. Simple meteor add randomwill be enough.

+10
source

Meteor, . , meteor add random, . Random , , , .

, random@1.0.4 api.use().

, , . : https://quip.com/RXFlAk9Rc2xI. .

+3

Source: https://habr.com/ru/post/1609123/


All Articles