问题
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