1

I created a meteor app which works fine on my localhost.

I recently just deployed my app to meteors server for testing and each time I visit the app I get a page with the text

This site is down. Try again later.

When I deploy I type:

meteor deploy [app-name] 

It deploys successfully but when I actually visit the site, it says it is down.

I’ve tried the following:

  1. Deleting the deployed app and re-uploading, but I experience the same error.
  2. Deploying a brand new meteor app, still says same site is down error.
  3. Deleting the app, reseting my local database with meteor reset, and redeploying. Same error.

Can I do something to fix this, or is this an error with Meteor's servers?

--------------------UPDATE-----------------------

The site is not showing because it is crashing. Using Meteor logs [app-name] I was able to find out that it was crashing because it cannot find module async.

I have my meteor project setup for NPM integration. I used npm install async and use

async = Meteor.require('async')

But I think the issue is with my package.json file.

Here is my current package.json

{
  "async": "0.9.0"
}

Is meteor not able to install async on the server because this package.json file is incorrect? Everything works on my localhost but I used npm install async specifically.

----------------------------UPDATE 2-----------------------

I fixed it with the help of this thread:

How can I deploy node modules in a Meteor app on meteor.com?

Community
  • 1
  • 1
Nearpoint
  • 7,202
  • 13
  • 46
  • 74
  • Have you tried visiting it again after ~5 seconds? – Peppe L-G Jul 02 '14 at 16:21
  • 4
    `meteor logs [app-name]` to see if your app is constantly crashing – imslavko Jul 02 '14 at 16:23
  • It is crashing. Says it cannot find module async. I installed async using meteor npm package support on the server. I also have async included in the front end by including it in the libs folder. Everything works on my localhost, How do I get it to work on the server? – Nearpoint Jul 02 '14 at 16:47

1 Answers1

1

You have to be a bit careful with NPM modules. meteor deploy doesn't support binary npm or installing npm modules via npm install from a package.json.

This may be what is causing you issues. Unfortunately, there isn't a way passed this. You could use your own server via DigitalOcean or AWS to get passed this.

Tarang
  • 75,157
  • 39
  • 215
  • 276
  • This is rather new behavior in 0.8.2. – Andrew Mao Jul 02 '14 at 17:21
  • @AndrewMao there was a change that stops using `--force` to install npm modules that forces them to rebuild. (https://github.com/meteor/meteor/blob/devel/History.md under 0.8.2) – Tarang Jul 02 '14 at 17:23
  • There is a way around it! http://stackoverflow.com/questions/10476170/how-can-i-deploy-node-modules-in-a-meteor-app-on-meteor-com I just got it to work by including the npm module in the public directory. And I tested it and the module is still available server side. Any downsides to this? – Nearpoint Jul 02 '14 at 17:23
  • @nearpoint yes this would work. Im not sure there are any downsides to this besides maybe meteor confusing the stuff inside the dir as meteor project material. Pre 0.6.2 this was the workaround to get npm working – Tarang Jul 02 '14 at 17:25
  • What about after 0.6.2? Do they just recommend not using them at all? Also before I used to have the npm_modules folder in the root directory of my project. Now it lives inside the public folder. I originally just used Meteor.require and it worked locally. But if I want to use meteor.com to deploy then I have to do it this way. It seems like just using Meteor.require is much simpler. – Nearpoint Jul 02 '14 at 17:26
  • @nearpoint After 0.6.2 they had a built in way of doing it with normal npm wrappers but i'm not sure this works well with meteor-npm (which works better for non meteor deploy/galaxy installs, stuff which uses a `package.json`). The binary npm module stuff hasn't yet been sorted with meteor. I think they're going to make it work with their commercial galaxy product. The way that works well is using a plain npm wrapper like most of the packages on atmosphere that wrap around existing npm modules. – Tarang Jul 02 '14 at 17:28
  • Well it currently did work when I used Meteor.require() and simply used npm install [package-name] inside my Meteor directory. It just crashed when deployed to meteor.com. Is this what you meant by referring to the built in way of including npm modules after 0.6.2? By just using Meteor.require, and npm installing in root directory? Is this way of doing it the final plan your talking about but just working with Meteor.com deployment? – Nearpoint Jul 02 '14 at 17:37
  • @nearpoint when you use Meteor.require it means you need to install packages via `npm install` which grabs the packages from `packages.json` (at least how I understand it). The ordinary Meteor way of supporting npm modules is building your own package as a wrapper (like this one https://github.com/avital/meteor-xml2js-npm-demo). This way Meteor installs the npm modules defined in each package's Npm.depends. This is the official way npm modules are supported (including on meteor deploy), though this way npm modules with binaries aren't supported cross platform (if you build on a mac) – Tarang Jul 02 '14 at 17:46
  • Thanks for the info. So in conclusion, if I want to use npm package, and host it on any server including meteor.com, I have to do it the way mentioned on the other thread, correct? Also when installing the npm package this way, by putting in the public/node_modules folder, do the packages run on both server and client? Will I run into problems with certain packages in the public folder, because some node modules must be server only? – Nearpoint Jul 02 '14 at 20:57