After updating my project: ReferenceError: check is not defined

I had a project worked well with meteor
I did new installation for meteor to update it to version 1.2
I created a new project, copied all files of my old project
Then I did meteor add for all of the packages I used in the old project
After that I did meteor

I got this problem:

I20150925-14:58:48.269(2)? Exception while invoking method 'addUser' ReferenceError: check is not defined
I20150925-14:58:48.269(2)?     at [object Object].Meteor.methods.addUser (server/models/users.js:4:3)
I20150925-14:58:48.269(2)?     at maybeAuditArgumentChecks (livedata_server.js:1692:12)
I20150925-14:58:48.269(2)?     at livedata_server.js:708:19
I20150925-14:58:48.269(2)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150925-14:58:48.270(2)?     at livedata_server.js:706:40
I20150925-14:58:48.270(2)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)
I20150925-14:58:48.270(2)?     at livedata_server.js:704:46
I20150925-14:58:48.270(2)?     at tryCallTwo (/home/ahmed/.meteor/packages/promise/.
I20150925-14:58:48.270(2)?     at doResolve (/home/ahmed/.meteor/packages/promise/.
I20150925-14:58:48.271(2)?     at new Promise (/home/ahmed/.meteor/packages/promise/.

addUser is a method allow admin to add users, and It has those checks:

	addUser: function(userAttributes) {
		check(Meteor.userId(), String);
		check(userAttributes, {
			username: String,
			password: String

		var currentUserId = Meteor.user()._id;
		var adminId = Meteor.users.findOne({username: 'admin'});

		if (currentUserId === adminId._id) {
			return true;

		} else {
			console.log("Someone - not permitted - tryied to create user.");
			return false

	insert: function(userId, doc) {
		var username = Meteor.user().username;
		return username === "admin"

Some told me that he hadn’t get the ‘check’ issue.

1 Like


meteor add check


Really!! It worked.
Did meteor team divided meteor to smaller packages :smile:

1 Like

meteor-platform is deprecated as of 1.2 (it still exists and would have solved your problem). The packages it pulls (pulled) in may be seen here:

Tho’ to be fair, the documentation has been suggesting for sometime (perhaps as far back 0.6 iirc) that project dependency packages should be explicitly declared even if they were in the core (meteor-platform) because at some stage they might be deprecated

now they have :wink:

1 Like

OMG thank you!!! Saved me serious hassle!

1 Like

Thank you friend. :grinning: