[英]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.