7

I was using meteor 0.8.x but recently tried to upgrade to 0.9.2. It works locally but I'm not having any luck with meteor bundle or meteor build

First I got this error

/var/projects/myproject/live/bundle/programs/server/boot.js:198
}).run();
   ^
Error: /var/projects/myproject/live/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node: invalid ELF header
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at bindings (/var/projects/myproject/live/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
    at Object.<anonymous> (/var/projects/myproject/live/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/bcrypt.js:1:97)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)

Things I've tried

  • Made sure live/bundle/programs/server/node_modules does not exist before starting.
  • ran npm install in live/bundle/programs/server as the README says to

Things I noticed. There's no bcrypt deps in live/bundle/programs/server/package.json. In 0.8.2 I had commands to install both fibers and bcrypt manually but apparently I don't need the fibers one anymore. It looks like I do need the bcrypt one but it's in a different location than it used to be.

I don't see anything in the docs about needing to go to /var/projects/myproject/live/bundle/programs/server/npm/npm-bcrypt and install bcrypt. I can manually delete it but am I doing something wrong?

Like I said I'm already installing it where 0.8.2 needed it in programs/server. Should I be manually installing in program/server/npm/npm-bcrypt? Should I add that to my list of places to ignore

I put that in just to try it and so now I get this error

/var/projects/myproject/live/bundle/programs/server/node_modules/fibers/future.js:173
                        throw(ex);
                              ^
Error: Cannot find module 'websocket-driver'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/var/projects/myproject/live/bundle/programs/server/npm/ddp/node_modules/faye-websocket/lib/faye/websocket.js:8:14)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)

Is that yet another module I need to manually install? I'm getting the impression I'm just doing something fundamentally wrong.

I've got the following meteor packages

.meteor/packages

# Meteor packages used by this project, one per line.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

standard-app-packages
audit-argument-checks
iron:router@0.9.3
meteorhacks:npm@1.2.0

npm-container

packages.json

{
  "semver": "2.3.1",
  "winston": "0.7.3",
  "winston-loggly": "1.0.1"
}

note: I'm developing/bundling on OSX but deploying on Ubuntu.

gman
  • 100,619
  • 31
  • 269
  • 393

2 Answers2

7

I had similar problems - I posted my solution over on DO

https://www.digitalocean.com/community/tutorials/how-to-deploy-a-meteor-js-application-on-ubuntu-14-04-with-nginx?comment=19780


UPDATE - Here is the answer from that forum:

If anyone else has an issue like this with bcrypt - the app probably has its own copy in /home/yourapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/

delete that noise. Then do this.

cd /home/yourapp/bundle/programs/server

npm install bcrypt

Then

cp -r /home/yourapp/bundle/programs/server/node_modules/bcrypt /home/yourapp/bundle/programs/server/npm/npm-bcrypt/node_modules/bcrypt/

then start your app and enjoy the meteory goodness.

TimDog
  • 8,758
  • 5
  • 41
  • 50
William Hall
  • 199
  • 2
  • 3
  • 1
    solved it for me. I don't understand why bcrypt wouldn't be included in the `package.json` by Meteor when building, so that a standard `npm install` when deploying automatically recompiles the package instead of moving a platform dependent .js file around. – cneuro Apr 19 '15 at 18:14
0

On the general problem of . . .

(for those stumbling here via Google)

Cannot find module 'MODULE-NAME'

or

Can't find npm module 'MODULE-NAME'

If you've recently added or removed packages while the application is running, try stopping and restarting your meteor application.

// stop ( "CTRL+C" in terminal that launched process )
$ kill `ps ax | grep '[m]eteor' | awk '{print $1}'`

// start
$ meteor
Old McStopher
  • 6,295
  • 10
  • 60
  • 89