Explain arguments to Npm.depends if you try to use it naively

This commit is contained in:
Avital Oliver
2013-04-04 15:45:57 -07:00
parent c44c092e39
commit e5a8e33dfa

View File

@@ -112,6 +112,8 @@ var Package = function () {
depends: function (npmDependencies) {
if (self.npmDependencies)
throw new Error("Can only call `Npm.depends` once in package " + self.name + ".");
if (typeof npmDependencies !== 'object')
throw new Error("The argument to Npm.depends should look like: {gcd: '0.0.0'}");
// don't allow npm fuzzy versions so that there is complete
// consistency when deploying a meteor app