【问题标题】:Problems with Meteor deployment related to fibers module与光纤模块相关的 Meteor 部署问题
【发布时间】:2013-07-10 11:41:01
【问题描述】:

在尝试部署流星时,我通过以下方式安装节点光纤:

$ cd bundle/server

然后安装光纤

$ npm install fibers

似乎已安装,但显示以下消息:

`linux-x64-v8-3.14` exists; testing
Binary is fine; exiting
fibers@1.0.1 node_modules/fibers

但是,在使用以下代码部署代码时:

node bundle/main.js

我收到此错误:

throw new Error('`'+ modPath+ '.node` is missing. Try reinstalling `node-fibe
~/main_repo/bundle/server/node_modules/fibers/bin/linux-x64-v8-3.20/fibers.node` is missing. Try reinstalling `node-fibers`?

我可以看到 linux-x64-v8-3.xx 的版本不同。我正在使用 Ubuntu 13.04

节点版本为 v0.11.3 NPM 版本为 1.2.18

【问题讨论】:

  • 你为什么要这样做?只需使用meteor bundle mydeploy.zip 捆绑即可。
  • 试试npm install -g fibers
  • 这些步骤是在使用流星包之后。我使用安装/卸载纤程,因为这就是我在其他服务器上部署的方式。npm -g install fiber 也会给我同样的错误。
  • 首先,Meteor 还不能在 Node 0.11 上运行。 0.8.18 是官方支持的节点版本。也许这就是问题所在?
  • 我使用 nvm 降级到 node 的 v0.8.18 和 npm 的 1.2.2。但是,它仍然给我同样的问题。新消息是linux-x64-v8-3.11 存在;测试。注意之前,它说的是3.14。但是,在部署时,它仍然给我“尝试重新安装 `node-fibers”,寻找“linux-x64-v8-3.20/fibers.node”。为什么要找这个文件。我尝试更改代码,以便改为查找 3.14。硬编码对我不起作用。

标签: meteor node-fibers


【解决方案1】:

您需要先卸载纤程以删除与您的服务器平台不兼容的二进制文件。

cd bundle/server
npm uninstall fibers 
npm install fibers

只有当你的服务器使用不同的平台时,你才需要这样做,即如果你的开发电脑不是 ubuntu。

【讨论】:

  • 我们在 osX 上开发。我们部署在 CentOS 上。在这种情况下,我们使用卸载/安装纤程方法,它可以完美运行。但是,由于 apache 在同一台服务器上运行的一些问题,很多解决方案,如反向代理和绑定到另一个 IP 似乎都不能完美运行。因此,我们将部署转移到另一台运行 Ubuntu 13.04 的机器上。这就是我们陷入困境的原因。
【解决方案2】:

存在一些版本问题。 它对我有用:

cd bundle/server
npm uninstall fibers
npm install fibers@1.0.0 

【讨论】:

    【解决方案3】:

    这是我所做的:

    sudo npm install -g nvm
    
    npm WARN deprecated nvm@0.0.3: This is NOT the correct nvm. Visit http://nvm.sh and use the curl command to install it.
    

    然后我把 nvm 用这个:

    curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.30.1/install.sh | bash
    

    npm 给出了这样的警告:

    => You currently have modules installed globally with `npm`. These will no
    => longer be linked to the active version of Node when you install a new node
    => with `nvm`; and they may (depending on how you construct your `$PATH`)
    => override the binaries of modules installed with `nvm`:
    
    /usr/local/lib
    ├── bitcoinjs-lib@2.1.4
    ├── bower@1.6.5
    ├── cordova@5.4.1
    ├── ember-cli@1.13.8
    ├── fibers@1.0.8
    ├── grunt-cli@0.1.13
    ├── gulp@3.9.0
    ├── ionic@1.7.12
    ├── ios-deploy@1.8.2
    ├── ios-sim@5.0.3
    ├── lite-server@1.3.2
    └── nvm@0.0.3
    
    => If you wish to uninstall them at a later point (or re-install them under your
    => `nvm` Nodes), you can remove them from the system Node as follows:
    
         $ nvm use system
         $ npm uninstall -g a_module
    

    所以我做了nvm use system。 现在使用节点的系统版本:v4.2.4 (npm v2.14.12)

    去卸载所有东西:

    sh-3.2# npm uninstall -g bower
    unbuild bower@1.6.5
    sh-3.2# npm uninstall -g cordova
    unbuild cordova@5.4.1
    sh-3.2# npm uninstall -g ember-cli
    unbuild ember-cli@1.13.8
    sh-3.2# npm uninstall -g fibers
    unbuild fibers@1.0.8
    sh-3.2# npm uninstall -g grunt-cli
    unbuild grunt-cli@0.1.13
    sh-3.2# npm uninstall -g gulp
    unbuild gulp@3.9.0
    sh-3.2# npm uninstall -g ionic
    unbuild ionic@1.7.12
    sh-3.2# npm uninstall -g ios-deploy
    unbuild ios-deploy@1.8.2
    sh-3.2# npm uninstall -g ios-sim
    unbuild ios-sim@5.0.3
    sh-3.2# npm uninstall -g lite-server
    unbuild lite-server@1.3.2
    sh-3.2# npm uninstall -g nvm
    unbuild nvm@0.0.3
    sh-3.2#
    
    Downgraded to node 0.10.36:
    
    nvm install 0.10.36
    

    现在也许我可以运行它了。所以我删除了整个 app 文件夹并用这个重新创建:

    hotel:Sites tom$ meteor create --example localmarket
    Created a new Meteor app in 'localmarket'.
    

    要运行您的新应用:

    cd localmarket
    meteor
    

    如果您是 Meteor 的新手,请尝试这里的一些学习资源:https://www.meteor.com/learn

    hotel:Sites tom$ cd localmarket/
    hotel:localmarket tom$ meteor
    [[[[[ ~/Dropbox/Sites/localmarket ]]]]]
    
    => Started proxy.
    => Started MongoDB.
    W20160118-22:04:11.145(13)? (STDERR)
    W20160118-22:04:11.146(13)? (STDERR) module.js:340
    W20160118-22:04:11.147(13)? (STDERR)     throw err;
    W20160118-22:04:11.148(13)? (STDERR)           ^
    W20160118-22:04:11.148(13)? (STDERR) Error: Cannot find module 'fibers'
    W20160118-22:04:11.148(13)? (STDERR)     at Function.Module._resolveFilename (module.js:338:15)
    W20160118-22:04:11.148(13)? (STDERR)     at Function.Module._load (module.js:280:25)
    W20160118-22:04:11.148(13)? (STDERR)     at Module.require (module.js:364:17)
    W20160118-22:04:11.149(13)? (STDERR)     at require (module.js:380:17)
    W20160118-22:04:11.149(13)? (STDERR)     at Object.<anonymous> (/Users/tom/Dropbox/Sites/localmarket/.meteor/local/build/programs/server/boot.js:1:75)
    W20160118-22:04:11.149(13)? (STDERR)     at Module._compile (module.js:456:26)
    W20160118-22:04:11.149(13)? (STDERR)     at Object.Module._extensions..js (module.js:474:10)
    W20160118-22:04:11.149(13)? (STDERR)     at Module.load (module.js:356:32)
    W20160118-22:04:11.149(13)? (STDERR)     at Function.Module._load (module.js:312:12)
    W20160118-22:04:11.150(13)? (STDERR)     at Module.require (module.js:364:17)
    => Exited with code: 8
    W20160118-22:04:21.515(13)? (STDERR)
    W20160118-22:04:21.516(13)? (STDERR) module.js:340
    W20160118-22:04:21.516(13)? (STDERR)     throw err;
    W20160118-22:04:21.516(13)? (STDERR)           ^
    W20160118-22:04:21.516(13)? (STDERR) Error: Cannot find module 'fibers'
    W20160118-22:04:21.516(13)? (STDERR)     at Function.Module._resolveFilename (module.js:338:15)
    W20160118-22:04:21.517(13)? (STDERR)     at Function.Module._load (module.js:280:25)
    W20160118-22:04:21.517(13)? (STDERR)     at Module.require (module.js:364:17)
    W20160118-22:04:21.517(13)? (STDERR)     at require (module.js:380:17)
    W20160118-22:04:21.517(13)? (STDERR)     at Object.<anonymous> (/Users/tom/Dropbox/Sites/localmarket/.meteor/local/build/programs/server/boot.js:1:75)
    W20160118-22:04:21.517(13)? (STDERR)     at Module._compile (module.js:456:26)
    W20160118-22:04:21.519(13)? (STDERR)     at Object.Module._extensions..js (module.js:474:10)
    W20160118-22:04:21.519(13)? (STDERR)     at Module.load (module.js:356:32)
    W20160118-22:04:21.519(13)? (STDERR)     at Function.Module._load (module.js:312:12)
    W20160118-22:04:21.519(13)? (STDERR)     at Module.require (module.js:364:17)
    

    啊,好吧,那没用。

    【讨论】:

      【解决方案4】:

      节点版本是v0.11.3 NPM版本是1.2.18

      Meteor 1.3.3 及之前的版本只能使用 Node v0.10.4x。

      使用nvm 运行特定的节点版本。

      参考文献

      【讨论】:

        猜你喜欢
        • 2016-11-27
        • 1970-01-01
        • 2015-08-22
        • 1970-01-01
        • 1970-01-01
        • 2013-12-05
        • 2013-06-16
        • 1970-01-01
        • 2013-07-30
        相关资源
        最近更新 更多