Problems installing sitemap

Viewed 148

i'm trying to install react-router-sitemap in my application but when i run the command "node sitemap-generator.js" (after the configuration) this message on my console came out:

    internal/modules/cjs/loader.js:960
    throw err;
    ^

    Error: Cannot find module '/home/ricardo/xxxx/sitemap-generator.js'
        at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
        at Function.Module._load (internal/modules/cjs/loader.js:840:27)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
        at internal/main/run_main_module.js:18:47 {
    code: 'MODULE_NOT_FOUND',
    requireStack: []
    }

in the installation i've created a file called "sitemap-builder.js" (within src):

    require('babel-register');

    const router = require('../src/router/routes').default;
    const Sitemap = require('./').default;

    function generateSitemap() {
        return (
        new Sitemap(router())
        .build("https://www.web.com")
        //Save it wherever you want
        .save("../public/sitemap.xml")
        );
    }

    generateSitemap();
0 Answers
Related