This is what our app looks like when starting:
=> Started proxy.
=> Started MongoDB.
>>>>> IN ON_TEST
meteor-collection-management: updating npm dependencies -- mongodb...
=> Errors prevented startup:
While building package `meteor-collection-management`:
error: Can't install npm dependencies. Are you connected to the internet?
=> Your application has errors. Waiting for file change.
Argh. In meteor-collection-management/package.js (our own package), there is this:
Package.on_test(function(api) {
console.log(">>>>> IN ON_TEST");
Npm.depends({
mongodb: "1.4.1"
});
api.use(['meteor-collection-management', 'tinytest', 'test-helpers']);
api.add_files('tests/dbobject-test.js', ['client', 'server']);
api.add_files('tests/enums-test.js', ['client', 'server']);
});
When I removed the Npm bit, I could now work without it trying to connect to the network. But this is a complete hack.
The mongodb package is downloaded as best as I can tell; We haven't changed the version number in ages; and if I do have internet connection the app does start up successfully.
Any thoughts on how to debug this even if you don't know the answer?
The reason your app must keep re-downloading the Npm modules is you may have multiple apps with different Meteor versions. When you run a different app (or even the same app) with a different version of Meteor, it clears out the build cache and forces the Npm modules to rebuild.
At least that's the main reason Npm modules are rebuilt. If you have multiple apps, ensure all use the latest version (also not the one from devel) or else it will keep doing this.
Other reasons may be it doesn't install the first time, but in this case it throws errors.