当使用'gcloud'模块时,NodeJs Google计算引擎无效ELF标头
我正在开发一个需要我使用gcloud nodejs模块的项目。 我正在使用node app
在本地testing此项目,并使用gcloud preview app run app.yaml
在gcloud上进行本地testing。 当我在我的文件中有下面的代码项目运行与node app
但不运行gcloud使用gcloud preview app run app.yaml
– 我得到一个invalid ELF Header
错误。
var gcloud = require('gcloud');
我相信该项目不会运行gcloud命令,因为它与我在项目中使用gcloud模块有关。 如果我从我的文件中删除该代码,该项目运行得很好,用gcloud命令。 我该怎么办才能解决这个问题?
我能够通过使用try-catch来获得错误
try { var gcloud = require('gcloud'); } catch (e) { e = 'Error loading required classes for gcloud: '+gcloud+ ': '+e console.log(e) res.status(200).send(e); }
错误:
Error loading required classes for gcloud: undefined: Error: /app/node_modules/gcloud/node_modules/hash-stream- validation/node_modules/sse4_crc32/build/Release/sse4_crc32.node: invalid ELF header
我能够通过删除node_modules
目录然后部署项目来解决此问题。 这个问题与OS X编译的库不能在Linux机器上工作有关。 因此,需要在Linux机器上进行全新安装 – 直接删除node_modules将直接强制在Linux机器上安装。
- 在Google云端平台上部署MEAN.JS
- Google云端应用程序引擎上的节点应用程序在低于1024的端口上侦听
- 使用Google Compute Engine加载nodejs上的testing瓶颈
- Google Compute Engine Bookshelf教程:npm ERR! networking读取ECONNRESET
- 如何在Google Compute Engine上部署节点应用程序?
- 使用Google云端平台进行部署时出错
- Google Compute Engine(GCE)允许使用WebSockets
- Cloud Server vs Local上的NodeJSdate不同
- 谷歌云健康检查失败