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

时间:2015-09-20 13:06:12

标签: node.js google-app-engine google-compute-engine gcloud

我有一个Node.js应用程序,它可以在localhost上正常运行,但不能在Compute Engine VM中运行。这是一个片段:

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);
}

当我运行此代码时

  

undefined:错误:/app/node_modules/gcloud/node_modules/hash-stream-validation/node_modules/sse4_crc32/build/Release/sse4_crc32.node:无效的ELF标题

看起来我无法导入gcloud类,但我无法理解为什么它在localhost中工作但不在GCE服务器中工作?

1 个答案:

答案 0 :(得分:1)

无效的ELF声音,例如您从localhost上传或在其他环境中编译的声音。这些deps需要在Google服务器上进行编译/配置。您是否关注these instructions

相关问题