gpt4 book ai didi

node.js - meteor 运行服务器获取错误: “Could not locate the bindings file. […]bcrypt[…]”

转载 作者:行者123 更新时间:2023-12-02 20:20:48 26 4
gpt4 key购买 nike

问题

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



有谁知道如何解决这个错误?

解决问题的尝试失败

  • 按建议的here运行npm rebuild无效
  • Nick Bull的建议:运行npm install --unsafe-perm node-gypnpm install --unsafe-perm libxmljs不起作用。两者都在/home/build/bundle/programs/server中的docker容器中执行。 (由于docker镜像中的根权限,--unsafe-perm标志为needed)

  • 细节
  • Dockerfile(受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

  • node main.js文件夹中运行bundle时出现错误消息:

  • /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)

    最佳答案

    根据许多online sources,这是node-gyp中的错误。试试这个:

    npm install node-gyp
    npm install libxmljs

    看看会发生什么。

    关于node.js - meteor 运行服务器获取错误: “Could not locate the bindings file. […]bcrypt[…]”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38808841/

    26 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com