Node.js crypto.randomBytes() is not a function
09:28 03 Jan 2022

For some reason a function I am calling is apparently not a function.

Welcome to Node.js v14.15.1.
Type ".help" for more information.
> const crypto = require("crypto");
undefined
> x = crypto.randomBytes(32).toString("hex")
Uncaught TypeError: crypto.randomBytes is not a function

Documentation for randomBytes().

Is there something I am not understanding?

javascript node.js node-crypto