Meteor build does not work on windows


#1

hi

meteor 1.4 project. I created meteor build bundle on my windows 10 machine:meteor build C:\Users\MBJ\Documents\GitHub\meteorBundles

node 4.4.7 installed

unpacked the bundle and run the command,

(cd programs/server && npm install)
MONGO_URL=mongodb://user:pw@aws-us-east-1-portal.9.dblayer.com:15417/DBQRSMeteor http://52.50.134.241 node main.js

and I get this error on windows 2012 server

C:\Users\Qlik\Documents\deployments\QRSMeteor.tar\QRSMeteor\bundle>(cd programs/
server   && npm install )
npm WARN package.json meteor-dev-bundle@0.0.0 No description
npm WARN package.json meteor-dev-bundle@0.0.0 No repository field.
npm WARN package.json meteor-dev-bundle@0.0.0 No README data
npm WARN package.json meteor-dev-bundle@0.0.0 No license field.
/
> meteor-dev-bundle@0.0.0 install C:\Users\Qlik\Documents\deployments\QRSMeteor.
tar\QRSMeteor\bundle\programs\server
> node npm-rebuild.js

events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm ENOENT
    at exports._errnoException (util.js:873:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:442:9)
    at process._tickCallback (node.js:356:17)
    at Function.Module.runMain (module.js:443:11)
    at startup (node.js:139:18)
    at node.js:968:3

npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code ELIFECYCLE
npm ERR! meteor-dev-bundle@0.0.0 install: `node npm-rebuild.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the meteor-dev-bundle@0.0.0 install script 'node npm-rebuild.
js'.
npm ERR! This is most likely a problem with the meteor-dev-bundle package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node npm-rebuild.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs meteor-dev-bundle
npm ERR! Or if that isn't available, you can get their info via:

any ideas?


#2

After building the app, edit the package.json in programs/server:

{ 
  "main": "../../main.js",
  "scripts": {
    "start": "node ../../main"
  }
}

Then run npm start (from that directory)

OR

You can automate the process:

meteor build output --directory
cd output\bundle\programs\server
npm install -g json
json -I -f package.json -e "this.main='../../main.js'"
json -I -f package.json -e "this.scripts={ start: 'node ../../main' }"
npm install --production
npm start

#3

Thank you very much, Will try iT!

Verstuurd vanaf mijn iPhone


#4

No problem,

You might also want to check-out IISNode for managing the app process.

(Or consider a Windows PAAS like Azure)


#5

Thanks, my company makes a product (qlik sense) that for now only works on windows. So I created a demo server on amazon. At first I used the dev client to run it. Runs pretty ok. But is not meant for this job. and on my t2 I had no resources left… so now we have m1.

I want to run it using node 4.4.7 and also install forever. I also looked at using modulus.io but I got a (mongo driver error I guess), funny thing, the same mongo url did work when I used galaxy…

I had to update your proposal to include JSON " like

	{ 
	  "main": "../../main.js",
	  "scripts": {
		"start": "node ../../main"
	  }
	}

next step is to include the mongo url, something like this in my .bat file

cd C:\Users\Qlik\Documents\deployments\QRSMeteor.tar\QRSMeteor\bundle\programs\server
set ROOT_URL=http://saasdemo.qlik.com 
set MONGO_URL=mongodb://uk:p@aws-us-east-1-portal.9.dblayer.com:15417/DBQRSMeteor
set PORT=80
npm start --settings settings-production.json

#6

Not sure where you got the idea npm start accepts a settings option :slight_smile:

That is actually a feature of the Meteor build tool,

You need to parse the json and set as the environment variable “METEOR_SETTINGS”,

Something like this (assuming batch):

json -0 -f settings.json > temp.txt
SET /P METEOR_SETTINGS=<temp.txt
DEL temp.txt

#7

Hi, I get this error


#8

You need to make sure the package is installed (or use an alternative parser):

npm install -g json

#9

Thanks this works!!!