Closed
Description
TypeScript Version: 2.4.0 / nightly (2.5.0-dev.201xxxxx)
TypeScript compiler relies on node's 'crypto' module unconditionally:
Whereas node's documentation for crypto module explicitly states:
Determining if crypto support is unavailable
It is possible for Node.js to be built without including support for the crypto module. In such cases, calling require('crypto') will result in an error being thrown.let crypto; try { crypto = require('crypto'); } catch (err) { console.log('crypto support is disabled!'); }
That means on a reduced node environment the compiler crashes unnecessarily. By unnecessarily I mean the support for crypto is already optional in the compiler:
Expected behavior:
TSC to work without 'crypto'
Actual behavior:
TSC fails without 'crypto'