react-router-sitemap giving ERROR Failed at the [email protected] sitemap script

I have a React router-based Single-Page-App and I’m trying to generate the sitemap links using react-router-sitemap version:^1.2.0 but I’m getting the same error again. And giving me Errors in the CSS files. I’m trying different techniques for 6 hours. Please suggest some solution.

Routes.js

import React from 'react';
import { Route, Routes } from "react-router-dom"

import GameComponent from './GameComponent';
import PlayGame from './PlayGame';
import PrivacyPolicy from './PrivacyPolicy';
import TermsConditions from './TermsConditions';

function Routesdef(props) {
    return (

        <Routes>
            <Route exact path="/" element={<GameComponent suggested__Games={props.suggested__Games} games={props.ALL__GAMES} key="all" />} />
            <Route exact path="/gamecomponent/:category" element={<GameComponent suggested__Games={props.suggested__Games} games={props.ALL__GAMES} key="categoryWise" />} />
            <Route path="/playgame/:gamename/:title/:gameSource/:category/:index" element={<PlayGame games={props.ALL__GAMES} suggested__Games={props.suggested__Games} key="playing" />} />
            <Route exact path="/privacypolicy" element={<PrivacyPolicy />} />
            <Route exact path="/termsconditions" element={<TermsConditions />} />
        </Routes>

    )
}
export default Routesdef

sitemap-generator.js

require("babel-register")({
  presets: ["es2015", "react"]
});

const router = require('./Routes.js').default;
const Sitemap = require('react-router-sitemap').default;

(
  new Sitemap(router)
    .build('https://www.onlineplaygames.online')
    .save('./public/sitemap.xml')
);

Scripts in Package.json

  "scripts": {
    "build:staging": "env-cmd -f .env.staging npm run build",
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "sitemap": "babel-node src/sitemap-generator.js"
  },

Please Suggest some solution…????