When I try to access the
crypto object within my server.js, I get “ReferenceError: crypto is not defined”.
However, when I open the console, launch node and type
> crypto, I see that it is available.
I do see the following note on the node docs for crypto:
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.
…but that doesn’t explain its availability in the console.
Any thoughts as to what’s going on?