流星运行服务器收到错误:“无法找到绑定文件. [...] bcrypt [...]" [英] Meteor run server getting error: "Could not locate the bindings file. [...]bcrypt[...]"

查看:103
本文介绍了流星运行服务器收到错误:“无法找到绑定文件. [...] bcrypt [...]"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Docker映像中运行Meteor服务器应用程序.运行主文件以启动服务器会导致错误,请参见下面的详细信息: Could not locate the bindings file.(我的系统:Macbook Pro,OSX 10.11.4)

I try to run a Meteor server application in a Docker image. Running the main file to start the server results in an error, see details below: Could not locate the bindings file. (My system: Macbook Pro, OSX 10.11.4)

有人知道如何解决此错误吗?

Has anybody an idea how to solve this error?

  1. 按建议的此处运行npm rebuild无效 li>
  2. Nick Bull 的建议:运行npm install --unsafe-perm node-gypnpm install --unsafe-perm libxmljs无效.两者都在/home/build/bundle/programs/server中的docker容器中执行. (由于Docker映像中的根权限,--unsafe-perm标志为需要)
  1. Running npm rebuild as proposed here didn't work
  2. Proposal by Nick Bull: Running npm install --unsafe-perm node-gyp and npm install --unsafe-perm libxmljs didn't work. Both executed in the docker container in /home/build/bundle/programs/server. (The --unsafe-perm flag is needed due to root rights in docker image)

详细信息

  1. Dockerfile(受 meteorhacks/meteord 启发)
  1. The Dockerfile (inspired by meteorhacks/meteord)

FROM debian:wheezy

ENV sourcedir /home/source
ENV builddir /home/build
RUN mkdir ${sourcedir} && mkdir ${builddir}

RUN apt-get update -y
RUN apt-get install -y curl bzip2 build-essential python git

RUN \
    NODE_VERSION=4.4.7 \
    && NODE_ARCH=x64 \
    && NODE_DIST=node-v${NODE_VERSION}-linux-${NODE_ARCH} \
    && cd /tmp \
    && curl -O -L http://nodejs.org/dist/v${NODE_VERSION}/${NODE_DIST}.tar.gz \
    && tar xvzf ${NODE_DIST}.tar.gz \
    && rm -rf /opt/nodejs \
    && mv ${NODE_DIST} /opt/nodejs \
    && ln -sf /opt/nodejs/bin/node /usr/bin/node \
    && ln -sf /opt/nodejs/bin/npm /usr/bin/npm

RUN curl -sL https://install.meteor.com | sed s/--progress-bar/-sL/g | /bin/sh

ADD . ${sourcedir}
RUN cd ${sourcedir} \
    && meteor build  --directory ${builddir} --server=http://localhost:3000

RUN cd ${builddir}/bundle/programs/server/ && npm install

  1. bundle文件夹中运行node main.js时的错误消息:
  1. The Error message, when running node main.js in the bundle folder:

/home/build/bundle/programs/server/node_modules/fibers/future.js:280
                        throw(ex);
                        ^

Error: Could not locate the bindings file. Tried:
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build/Debug/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build/Release/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/out/Debug/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/Debug/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/out/Release/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/Release/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/build/default/bcrypt_lib.node
 → /home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/compiled/4.4.7/linux/x64/bcrypt_lib.node
    at bindings (/home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bindings/bindings.js:88:9)
    at Object.<anonymous> (/home/build/bundle/programs/server/npm/node_modules/meteor/npm-bcrypt/node_modules/bcrypt/bcrypt.js:3:35)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Module.Mp.load (/home/build/bundle/programs/server/npm/node_modules/meteor/babel-compiler/node_modules/reify/node/runtime.js:16:23)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.Npm.require (/home/build/bundle/programs/server/boot.js:190:18)

推荐答案

好的,我发现了这个错误: 问题是Dockerfile中环境变量buildir的定义: ENV builddir /home/build bcrypt的构建过程似乎使用相同的变量,并在该目录中构建文件bcrypt_lib.nodeobj.target.所以他们在正确的地方失踪了.

Okay I found the bug: The problem was the definition of the envrionment varibale buildir in the Dockerfile: ENV builddir /home/build The build process for bcrypt seems to use the same variable, and builds the files bcrypt_lib.node and obj.target in that directory. So they were missing in the right place.

这篇关于流星运行服务器收到错误:“无法找到绑定文件. [...] bcrypt [...]"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆