Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meteor: Random.fraction() issue

Tags:

meteor

I'm getting the following error when after installing my Meteor app (developed on an older version of Meteor) on Meteor version 1.2.0.1:

ReferenceError: Random is not defined

Offending line:

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

I've never had a problem with this line of code before and according to the docs this should still work.

Any ideas?

like image 523
user1532669 Avatar asked Dec 10 '22 20:12

user1532669


1 Answers

You've got to install the random package, it's not installed by default anymore. A simple meteor add random will suffice.

like image 186
Svenskunganka Avatar answered Feb 15 '23 07:02

Svenskunganka