When working with newer version of Nodejs like 20.0.0, oftentimes one may run into this error:

  throw err;

Error: Cannot find module '@babel/runtime/helpers/interopRequireDefault'

This arises from an outdated Babel runtime(from one of the libraries/frameworks in use), here’s how to resolve this issue:


  1. Update @babel/runtime to the latest version:

2 Install @babel/runtime:

npm add @babel/runtime

The above shall resolve the issue.

Find me on Twitter/ where I tweet about interesting topics on software development.