Installing isomorphic-git as a dependency fails


I am trying to work with isomorphic-git in a Atlas function. The dependency installed correctly but when using it the function fails with the error
failed to compile source for module 'isomorphic-git': SyntaxError: node_modules/isomorphic-git/index.cjs: Line 591:7 Unexpected token function (and 4422 more errors

Here is the code of my function

// This function is the endpoint's request handler.
exports = async function ({ headers, body }, response) {
  const git = require("isomorphic-git");

Is there a way to make this dependency work?