Reputation: 99960
I have the following code in my top-level meteorroot/lib directory:
//lib/collections/collectionsEnum.js
var collections = {};
COLLECTION_NAMES = Object.freeze({
EmployeesCollection:{
name:'EmployeesCollection',
value: getMeteorCollectionByName(name)
},
FoodCollection:{
name:'FoodCollection',
value: getMeteorCollectionByName(name)
},
PlayerCollection:{
name:'PlayerCollection',
value: getMeteorCollectionByName(name)
}
});
getMeteorCollectionByName = function(name){
for(var coll in COLLECTION_NAMES){
if(coll.name == name){
if(collections.name === undefined){
if(Meteor.isServer){
collections.name = new Meteor.Collection(name);
}
}
return collections.name;
}
}
return null;
}
I get this error when running >meteor
➜ oresoftware_meteor git:(master) ✗ meteor
[[[[[ ~/code/oresoftware_meteor ]]]]]
=> Started proxy.
/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:206
throw(ex);
Error: EACCES, readdir '/home/nitrous/code/oresoftware_meteor/lib/collections'
at Object.Future.wait (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/fibers/future.js:326:15)
at Object.wrapper (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/files.js:1124:24)
at readDirectory (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:229:26)
at Object.readAndWatchDirectory (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/watch.js:650:18)
at readAndWatchDirectory (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/package-source.js:1551:32)
at [object Object].sourceArch.getSourcesFunc (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/package-source.js:1621:47)
at compileUnibuild (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/compiler.js:291:37)
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/compiler.js:135:26
at Array.forEach (native)
at Function._.each._.forEach (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/dev_bundle/lib/node_modules/underscore/underscore.js:79:11)
at Object.compiler.compile (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/compiler.js:131:5)
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/bundler.js:2023:24
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/buildmessage.js:264:13
at [object Object]._.extend.withValue (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/fiber-helpers.js:115:14)
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/buildmessage.js:257:29
at [object Object]._.extend.withValue (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/fiber-helpers.js:115:14)
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/buildmessage.js:255:18
at [object Object]._.extend.withValue (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/fiber-helpers.js:115:14)
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/buildmessage.js:246:23
at [object Object]._.extend.withValue (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/fiber-helpers.js:115:14)
at Object.capture (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/buildmessage.js:245:19)
at Object.exports.bundle (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/bundler.js:1975:31)
at bundleApp (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:508:34)
at [object Object]._.extend._runOnce (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:544:35)
at [object Object]._.extend._fiber (/home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:771:28)
at /home/nitrous/.meteor/packages/meteor-tool/.1.0.40.1ef5dzv++os.linux.x86_64+web.browser+web.cordova/meteor-tool-os.linux.x86_64/tools/run-app.js:366:12
- - - - -
the Object.freeze() call and the isMeteor() call don't seem to be causing the problem. I did the isMeteor call because I don't believe you are supposed to call new Meteor.Collection() from the client, but I'd have to triple check that.
Upvotes: 0
Views: 94
Reputation: 64312
An EACCES
error means you don't have permissions to perform the current file operation. This usually happens after you run or modify something in your project as root. Try:
$ sudo chown $USER:$USER [filename]
In your case, this would look like:
$ sudo chown $USER:$USER /home/nitrous/code/oresoftware_meteor/lib/collections
If you get more EACCES
errors, you may need to chown
your whole directory with:
$ cd /home/nitrous/code/oresoftware_meteor
$ sudo chown -R $USER:$USER .
Upvotes: 1