title: error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor
body: <p>I install</p>
  
  <pre><code>npm install -g typescript
  </code></pre>
  
  <p>then I want to compile my main.ts class but I always got this error</p>
  
  <pre><code>main.ts:14:2 - error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor.  Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your `--lib` option.
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>import { OrderWatcher, OnOrderStateChangeCallback, OrderWatcherConfig } from '@0xproject/order-watcher';
  import { SignerSubprovider, RPCSubprovider, Web3ProviderEngine } from '@0xproject/subproviders';
  import { Web3Wrapper } from '@0xproject/web3-wrapper';
  
  let url = 'https://mainnet.infura.io/xxx';
  //let url = 'http://localhost:8545';
  let provider = new RPCSubprovider(url);
  const providerEngine = new Web3ProviderEngine();
  providerEngine.addProvider(provider);
  providerEngine.start();
  
  let orderWatcher = null;
  
  (async () =&gt; {
      // Get all of the accounts through the Web3Wrapper
      const web3Wrapper = new Web3Wrapper(providerEngine);
      const blockNumber = await web3Wrapper.getBlockNumberAsync();
      const networkId = await web3Wrapper.getNetworkIdAsync();
  
      console.log(blockNumber);
      console.log(networkId);
  
      //let networkId = 1;
      //let partialConfig = new Partial&lt;OrderWatcherConfig&gt;();
  
      orderWatcher = new OrderWatcher(
       web3Wrapper.getProvider(), 
       networkId
       );
  
      //  orderWatcher.subscribe(
      //     ( error: Error|null, orderState?: OrderState ) : void =&gt; {
      //         console.log('callback');
      //         console.log(error);
      //         console.log(orderState);
  
      //     }
      //  );
  
      orderWatcher.subscribe(
          ( callback: OnOrderStateChangeCallback ) : void =&gt; {
              console.log('callback');
              //console.log(callback);
          }
       );
  
       console.log('end');
  })();
  
  console.log('end 2');
  </code></pre>
  
  <p>I have 2 questions?</p>
  
  <ol>
  <li>Why I can not use async? Why compiling main.ts throw an error</li>
  <li>callback always return an error</li>
  </ol>
  
  <blockquote>
    <p>Can not convert undefined or null to object</p>
  </blockquote>
  
  <p>EDIT</p>
  
  <p>my tsconfig.json</p>
  
  <pre><code>{
    "compilerOptions": {
      "lib": [ "dom","es2015" ]
    },
    "files": [
      "main.ts"
    ],
    "exclude": [
      "node_modules",
      "**/*.spec.ts"
    ]
  }
  </code></pre>