0

I'm trying to VMC push Calipso onto an instance of Micro Cloud Foundry that I have, and I'm getting thrown up by an error saying

Unable to load shared library /var/vcap/data/dea/apps/{App-Name&ID}/app/node_modules/bcrypt/build/Release/bcrypt_lib.node 
 at Object..node (module.js:463:11)
    at Module.load (module.js:351:31)
    at Function._load (module.js:310:12)
    at Module.require (module.js:357:17)
    at require (module.js:368:17)
    at bindings (/var/vcap/data/dea/apps/Apptain-0-cb7703ae25d61741a91f9a828959ea6e/app/node_modules/bcrypt/node_modules/bindings/bindings.js:74:15)
    at Object.<anonymous> (/var/vcap/data/dea/apps/{App-Name&ID}/app/node_modules/bcrypt/bcrypt.js:1:96)
    at Module._compile (module.js:432:26)
    at Object..js (module.js:450:10)
    at Module.load (module.js:351:31)

Line 74 of bcrypt/node_modules/bindings/bindings.js is

var b = require(n)

but it's odd because the whole block is

var tries = []
    , i = 0
    , l = opts.try.length
    , n

  for (; i<l; i++) {
    n = join.apply(null, opts.try[i].map(function (p) {
      return opts[p] || p
    }))
    tries.push(n)
    try {
      var b = require(n)
      b.path = n
      return b
    } catch (e) {
      if (!/not find/i.test(e.message)) {
        throw e
      }
    }
  }

so any exception should be getting caught and if necessary thrown farther down. I know I'm pretty far off the map, but any help anyone can offer would be appreciated. I can run local without issue, but start on MicroCloud fails.

1 Answer 1

1

Disclaimer: I am in a no way a node.js expert, but it seems there is something wrong with the path of the lib, namely the part "{App-Name&ID}".

As bcrypt is a native dep, there is special handling to be taken care of. All of this is explained here : http://blog.cloudfoundry.com/2012/05/24/cloud-foundry-supports-node-js-modules-with-npm/

You may want to check that out, if you haven't already. Also, I'm not quite sure if what is described in that blog post applies to (your version of) micro CloudFoundry. You may want to give it a try on the real cloudfoundry.com site to see if it solves your problem.

Sign up to request clarification or add additional context in comments.

8 Comments

"{App-Name&ID}" is just a placeholder I used for the actual name and ID of my App. { "ignoreNodeModules" : true }
I do have a cloudfoundry.json file containing the json { "ignoreNodeModules" : true }, and I also have an npm-shrinkwrap.json, so I would hope it would be ignoring the node_modules folder but it is not and if I pull bcrypt out of node_modules it fails looking for it. I'm right in line with the below blogs posts that was published in August, with the only difference being that I'm not deploying to a cloudfoundry.com subdomain so my microcloud is in offline mode (how I got it to work with regular domains).
Ok, I'm pretty sure the issue comes from the fact that micro (I guess you have 1.2.0) predates support for native modules. Can you try deploying on cf.com to confirm?
Eric is correct. The next refresh of Micro Cloud Foundry should resolve this issue.
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.