简体   繁体   English

无法在Google Compute Engine VM中运行应用程序

[英]Unable to run application in Google Compute Engine VM

I have a Node.js application which runs correctly on localhost, but not in the Compute Engine VM. 我有一个Node.js应用程序,该应用程序可以在localhost上正确运行,但不能在Compute Engine VM中运行。 Here is a snippet: 这是一个片段:

try {
    gcloud = require('gcloud');
    var storage = gcloud.storage({ projectId: 'project-id' });
    var bucket = storage.bucket('my-bucket');
    bucket.file(src_file).createReadStream().pipe(fs.createWriteStream(src_file));
} catch (e) {
    e = 'Error loading required classes for gcloud: '+gcloud+ ':  '+e
    console.log(e)
    res.status(200).send(e);
}

When I run this code 当我运行这段代码

undefined: Error: /app/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/sse4_crc32/build/Release/sse4_crc32.node: invalid ELF header 未定义:错误:/app/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/sse4_crc32/build/Release/sse4_crc32.node:无效的ELF标头

It looks like I'm not able to import the gcloud classes, but I can't understand why it works in localhost but not in the GCE server?? 看来我无法导入gcloud类,但是我不明白为什么它可以在localhost而不在GCE服务器上工作?

Invalid ELF sounds like you uploaded from localhost or compiled in a different environment. 无效的ELF声音听起来像是您从localhost上传或在其他环境中编译的。 Those deps need to be compiled/configured on the Google server. 这些部门需要在Google服务器上进行编译/配置。 Did you follow these instructions ? 您遵循这些指示了吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Google Computing Engine上更新托管VM的代码 - Updating code of managed vm on google compute engine 使用Google App Engine或Google Cloud Compute VM来测试“运行我的App”? - Use Google App Engine or Google Cloud Compute VM to Test Run My App? 如何在Google计算引擎中更新应用程序代码 - How to update application code in google compute engine 无法使用Google App Engine上的nodejs应用更新VM - Unable to update VM with nodejs app on Google App Engine 在Google Compute Engine Debian服务器上运行Node.js - Run Node.js on a Google Compute Engine Debian server 如何使用2个独立端口在Google计算引擎外部ip中运行nodejs - how to run nodejs in google compute engine external ip with 2 separate port 无法通过外部 IP (nodejs) 访问谷歌云计算引擎 VM - can't access google cloud compute engine VM through external IP (nodejs) 有没有办法检查 Google Compute Engine VM 是否准备好接收来自 firebase function 的 http 请求? - Is there a way to check if a Google Compute Engine VM is ready to receive a http request from a firebase function? Google Compute Engine上的Stackdriver Debugger - Stackdriver Debugger on Google Compute Engine 带有nodejs的Google Compute Engine上的SSL - SSL on Google Compute Engine with nodejs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM