简体   繁体   English

Google Cloud App Engine是否具有特殊的Node.js运行时?

[英]Does Google Cloud App Engine have a special Node.js runtime?

I tried to deploy my Node.js app on Google Cloud using a flexible App Engine. 我尝试使用灵活的App Engine在Google Cloud上部署Node.js应用程序。 On my local machine the project runs without errors, but on the cloud, it produces strange errors 在我的本地计算机上,项目运行没有错误,但是在云上却产生了奇怪的错误

Like the one, where I need to require the URL class, otherwise it's undefined, while on my machine it works without the require . 喜欢的人,我要在requireURL类,否则它是不确定的,而我的机器上它的工作原理没有require Another one I still couldn't figure out is when I Proxy the global Promise object, it comes back as a function, but mongoose fails to load, because global.Promise is not a function. 我仍然不知道的另一个是,当我Proxy全局Promise对象时,它作为一个函数返回,但是猫鼬无法加载,因为global.Promise不是一个函数。

I'm on the latest Node LTS version and using Yarn, so the dependencies definitely have the correct version. 我使用的是最新的Node LTS版本并使用Yarn,因此依赖项肯定具有正确的版本。 Is there a different Node.js runtime I'm not aware of? 有我不知道的其他Node.js运行时吗? Or is it an environment setting I can set? 还是我可以设置的环境设置?

Edit: These errors happen during build (maybe that has something to do with it?) 编辑:这些错误发生在构建过程中(也许与它有关?)

So it turns out the Google Cloud Builder doesn't use the latest node version by default. 因此,事实证明Google Cloud Builder默认不使用最新的节点版本。 I needed to specify it in the cloudbuilder.yaml , eg: 我需要在cloudbuilder.yaml指定它,例如:

steps:
- name: "gcr.io/cloud-builders/yarn:node-10.10.0"
  args: ["install", "--production"]

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

相关问题 如何保留部署在谷歌云应用引擎上的 node.js 应用的统计数据并保持我的数据持久化 - How to keep stats for a node.js app deployed on google cloud app engine and keep my data persistent 自定义运行时node.js - 无法在Google App Engine中查看我的自定义日志 - Custom Runtime node.js - Can't see my custom logs in Google App Engine App Engine Standard中的Node.JS如何处理崩溃? - How does Node.JS in App Engine Standard handle crashes? Node.js app,Express和Cloud Foundry - Node.js app, Express and Cloud Foundry 为什么 Google App 引擎不使用 Node.js 释放 memory - Why isn't Google App engine freeing memory using Node.js 将运行时更改为 Node.js 10 后,云 function 失败 - Cloud function fails after changing Runtime to Node.js 10 在Google Compute Engine Debian服务器上运行Node.js - Run Node.js on a Google Compute Engine Debian server 是否可以使用Node.js或其他一些服务器端JavaScript方法开发Google App Engine Web应用程序? - Is it possible to develop a Google App Engine web app using Node.js or some other server side JavaScript approach? 为什么 node.js 运行时比 Google chrome 控制台慢 - Why is node.js runtime slower than Google chrome Console 使用Node.js在App Engine上进行本地单元测试 - Local unit testing on app engine with Node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM