Node can't find perf_hooks modules

as the version.

Issue: Unable to use perf_hooks with Node.js version 10.15

I am trying to use perf_hooks for the performance API in node.js, as shown below:

const { performance } = require('perf_hooks');

However, I keep getting the following error:

Module not found: Error: Can't resolve 'perf_hooks'

My current node.js version is 10.15 (as determined by running node -v).


The perf_hooks module was introduced in Node.js version 8.5.0, so it is not available in Node.js version 10.15. To use perf_hooks, you will need to upgrade to a later version of Node.js.