#Could not load @nuxtjs/sitemap. Is it installed?

1 messages · Page 1 of 1 (latest)

muted wraith
#

I have started a new fresh project, install @nuxtjs/sitemap add it to nuxt.config.ts modules and then, when I start my application I have this error.

ERROR  Cannot start nuxt:  Could not load @nuxtjs/sitemap. Is it installed?
strong meteorBOT
#

Hi @muted wraith. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

Based on the information provided in the knowledge sources, it appears that you're encountering an issue with the @nuxtjs/sitemap module in a Nuxt 3 project. The error you're seeing suggests that the module is not properly installed or configured. Here's what you need to know:

  1. Version Compatibility: The @nuxtjs/sitemap module version 2.x is specifically for Nuxt 2. For Nuxt 3, you need to use a different module.

  2. Nuxt 3 Solution: For Nuxt 3, it's recommended to use the nuxt-simple-sitemap module instead of @nuxtjs/sitemap.

To resolve this issue, follow these steps:

  1. Uninstall the @nuxtjs/sitemap module:

    npm uninstall @nuxtjs/sitemap
    
  2. Install the nuxt-simple-sitemap module:

    npm install nuxt-simple-sitemap
    
  3. Update your nuxt.config.ts file to use the new module:

    export default defineNuxtConfig({
      modules: [
        'nuxt-simple-sitemap'
      ],
      // ... other configurations
    })
    
  4. Configure the sitemap as needed according to the nuxt-simple-sitemap documentation.

By making these changes, you should be able to generate a sitemap in your Nuxt 3 project without encountering the "Could not load @nuxtjs/sitemap" error.

For more detailed information on using sitemaps with Nuxt 3, you can refer to the Stack Overflow post which discusses this issue.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:

#

@muted wraith Kapa.ai is still learning and improving, please let me know how I did by reacting below.

worldly copper
#

I'm having the same issue, and other people have reported this too.

It was flagged as fixed yesterday #1330449872461103175 message but I don't think it is?

muted wraith
#

The issue is clearly not fixed, I have the latest version

runic arch
icy trellis
#

If you still have issues please confirm you're using the latest version (nuxi upgrade --force can help) and open an issue if it's still throwing an error