重新定义Cloudfoundry的“无效ELF标头” [英] Restify on Cloudfoundry 'invalid ELF header'

查看:91
本文介绍了重新定义Cloudfoundry的“无效ELF标头”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一个node.js应用程序部署到Cloudfoundry,唯一的模块依赖性是重新调整。我试过用本地node_modules目录推送它,并在cloudfoundry.json中使用npmrinkwrap和'ignoreModules',但总是在stdout.log中以

I'm deploying a node.js app to Cloudfoundry, the only module dependency is restify. I've tried pushing it with my local node_modules directory and also using npm shrinkwrap and 'ignoreModules' in cloudfoundry.json but always end up with this in the stdout.log:

{ stack: [Getter/Setter],
  arguments: undefined,
  type: undefined,
  message: '/var/vcap/data/dea/apps/myapp-0-6f9cf62f9bbe58f5d2eb13a94acb5d3a/app/node_modules/restify/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node: invalid ELF header' }

有什么想法吗?在此先感谢:)

Any ideas? Thanks in advance :)

编辑:对不起,我的意思是'ignore * Node * Modules'

sorry i mean 'ignore*Node*Modules'

推荐答案

我的猜测是该模块是为您的本地体系结构(例如x86)编译的,而尝试运行该模块的服务器是另一种体系结构(例如64位)。节点模块中可以包含npm可以处理的C ++扩展,您不一定要将node_modules文件夹中的二进制文件从一个平台移动到另一个平台,就需要重新编译它们。

My guess is the module is compiled for your local architecture (say x86), and the server trying to run it is a different architecture (say 64 bit). Node modules can have C++ extensions in them that npm will handle building, you can't necessarily just move the binaries in the node_modules folder from one platform to another, you need to recompile them.

我对Cloudfoundry的了解还不足以告诉您如何做到这一点,希望其他人能提供更好的答案。

I don't know enough about Cloudfoundry to tell you how to do that though, hopefully someone else has a better answer.

这篇关于重新定义Cloudfoundry的“无效ELF标头”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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