One Deployment Method for A Meteor Application on Windows

I am a total newb when it comes to iisnode (I hadn’t even heard of it let alone use it) … but … one would think that you would have to somehow map the port / URL on IIS to the port (and maybe URL) within the node / meteor application so it knows to go from http://some.domain:80/foo -> meteor iisnode :8080 ??

Also it would be a bit odd to not have iisnode output anything at all to stdout/stderr when things happen? Maybe within iisnode you can specify some log file to use? I think you are close …

Also – isn’t there an “issue” area for iisnode you can post to asking for help? Seems like this is the main issue and not much else…

1 Like

@ramijarrar are you also using iisnode v0.2.21 (x64)?

@sjmcdowall thanks for your feedback and suggestions. I’ve posted to the iisnode GitHub issues site but it’s not had any comments yet.

We are using v0.2.21 (x86) of IISNode on Azure App Service.

Are you still setting PORT? This will definitely conflict with the communication between IIS/Node.

PORT is set to 8080. If I unset PORT then there is a conflict because the default port binding the node app uses is 80, which is the same as the IIS site, so the node application fails to start.

Here is a link I found doing a little googling …

Getting Started with IISNODE

Seems like a great article to try to debug this, but lo and behold the first thing I get out of here is that PORT should NOT be set at all because it appears iisnode will set the PORT it wants you to listen to create a channel back to it. So I would make sure NO PORT is set anywhere and console.log the process.env.PORT at the start of the node main.js or where ever and see what port # it’s doing … are you sure you are letting iisnode LAUNCH your node application?

Anyway, maybe that article will help – seems useful to me.

Hello,
I am trying to deploy a meteor 1.5 application and so far I have been able ;

  • to generate the build successfully.
  • I cd programs/server && run npm install ( I got a few warning and these errors

'node-pre-gyp' is not recognized as an internal or external command, operable program or batch file. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! bcrypt@1.0.2 install:node-pre-gyp install --fallback-to-buildnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bcrypt@1.0.2 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! meteor-dev-bundle@0.0.0 install:node npm-rebuild.jsnpm ERR! Exit status 1 npm ERR! npm ERR! Failed at the meteor-dev-bundle@0.0.0 install script.

I ignored these and went on to cd into bundle and run node main.js and I got the following

`Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.
C:\ARBProd\bundle\programs\server\node_modules\fibers\future.js:280
throw(ex);
^

Error: MONGO_URL must be set in environment
at Object. (packages/mongo/remote_collection_driver.js:36:11)
at Object.defaultRemoteCollectionDriver (packages\underscore.js:784:19)
at new Mongo.Collection (packages/mongo/collection.js:99:40)
at AccountsServer.AccountsCommon (packages/accounts-base/accounts_common.js:23:18)
at new AccountsServer (packages/accounts-base/accounts_server.js:18:5)
at meteorInstall.node_modules.meteor.accounts-base.server_main.js (packages/accounts-base/server_main.js:9:12)
at fileEvaluate (packages\modules-runtime.js:197:9)
at require (packages\modules-runtime.js:120:16)
at C:\ARBProd\bundle\programs\server\packages\accounts-base.js:2019:15
at C:\ARBProd\bundle\programs\server\packages\accounts-base.js:2030:3`

Please help. I am assuming the last error requires me to install mongo and somehow set the url etc. I have always run mongo only from meteor and not sure how to go about all that. Please help, I really need to get the app running on production server now.

NB: all I have done so far is still on my development environment (windows 10 64bit)
how do you install mongo as a self starting service and link a db to meteor?
what else must I do to get the app running on current development machine (to simulate production) so I can replicate same steps on actual production machine

In order to install native bcrypt on Windows, you’ll need a full set of build utilities installing first. You could try meteor npm install --global windows-build-tools (see windows-build-tools - npm) for more info. However, the software version is normally fine, unless you’re expecting several thousand authentication requests per second!

That seems to be your real problem. Meteor installs a development version of MongoDB as part of its application build. Looking at your problem statement I’m not sure that you’re doing the right things in the right places. So, starting from scratch in my home directory, this is what I’d expect to see:

meteor create my-new-app
cd my-new-app
meteor npm i
meteor

BTW, this topic is about deploying a Meteor app. You seem to be discussing building a Meteor app.

@robfallows
I am actually discussing deployment to windows.
I have made more progress since i last posted here.
My current challenge is how to set the mongo_url as well as root_url for only the build version.
I set an environment variable for the MONGO_URL but it affected all other meteor apps on my development machine which i am using to test for production
currently when i run node main.js this is what i get,

`PS C:\ARBProd\bundle> node main.js
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.

C:\ARBProd\bundle\programs\server\node_modules\fibers\future.js:313
throw(ex);
^
MongoError: failed to connect to server [localhost:27017] on first connect
at Pool. (C:\ARBProd\bundle\programs\server\npm\node_modules\meteor\npm-mongo\node_modules\mongodb-core\lib\topologies\server.js:326:35)
at emitOne (events.js:96:13)
at Pool.emit (events.js:191:7)
at Connection. (C:\ARBProd\bundle\programs\server\npm\node_modules\meteor\npm-mongo\node_modules\mongodb-core\lib\connection\pool.js:270:12)
at Object.onceWrapper (events.js:293:19)
at emitTwo (events.js:106:13)
at Connection.emit (events.js:194:7)
at Socket. (C:\ARBProd\bundle\programs\server\npm\node_modules\meteor\npm-mongo\node_modules\mongodb-core\lib\connection\connection.js:175:49)
at Object.onceWrapper (events.js:293:19)
at emitOne (events.js:96:13)
PS C:\ARBProd\bundle> node main.js
Note: you are using a pure-JavaScript implementation of bcrypt.
While this implementation will work correctly, it is known to be
approximately three times slower than the native implementation.
In order to use the native implementation instead, run

meteor npm install --save bcrypt

in the root directory of your application.`

I have a discussion open here. Please have a look and help. Thanks