IBM Bluemix node.js本机Promise支持 [英] IBM Bluemix node.js native promise support

查看:70
本文介绍了IBM Bluemix node.js本机Promise支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的node.js应用程序中,我经常使用Promises。使用正式的node.js实现V4时,我没有任何问题。自0.13起,Node本身就支持Promises。

In my node.js application I use Promises very frequently. When working with the official node.js implementation V4 I don't have any problems. Node supports Promises since 0.13 natively.

当我切换到 IBM SDK for Node时。 js版本4 包含在IBMNode Docker容器中(FROM Registry.eu-gb.bluemix.net/ibmnode:latest)运行应用程序时出现以下错误:
ReferenceError:未定义Promise

When I switch to IBM SDK for Node.js Version 4 thats contained in the IBMNode Docker container (FROM registry.eu-gb.bluemix.net/ibmnode:latest) I get the following error when running my application: ReferenceError: Promise is not defined

IBM Node.js为什么不本地支持Promises,以及如何在不使用Promise的情况下启用本地支持承诺npm包并在我的代码中引用它?

Why does IBM Node.js not support Promises natively and how can I enable native support without having to use a Promise npm package and refer to it in my code?

推荐答案

在您的Dockerfile中,请尝试设置 FROM ibmnode:v4 代替 FROM ibmnode:latest 。尽管它们应该使用相同的版本,但您可能会以某种方式意外获得0.12.x。

In your Dockerfile, please try setting FROM ibmnode:v4 instead of FROM ibmnode:latest. Although they should refer to the same version, it may be possible that you're somehow accidentally getting 0.12.x.

这篇关于IBM Bluemix node.js本机Promise支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆