IBM Bluemix node.js native promise support

南楼画角 提交于 2019-12-11 13:48:55

问题


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.

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

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?


回答1:


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.



来源:https://stackoverflow.com/questions/35337679/ibm-bluemix-node-js-native-promise-support

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!