Strange error when trying to run dev mode on a fresh install
For some reason, I seem to be getting this error when trying to run dev mode on my fresh Nuxt installation. I only installed
nuxthub
:
Any idea what is going wrong here? It seems strange.3 Replies
Hi @Viridian. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
This error suggests there might be an issue with your Nuxt installation or configuration. Based on the knowledge sources provided, I can offer some insights and potential solutions:
1. The error indicates that the module './dev2.mjs' doesn't export 'createNuxtDevServer', which is unexpected for a fresh Nuxt installation. This could be due to a few reasons:
2. Incompatible versions: Make sure you're using compatible versions of Nuxt and its dependencies. The error message mentions [email protected], which is a recent version. Ensure all your packages are up to date.
3. Incomplete or corrupted installation: Try removing the node_modules folder and package-lock.json (or yarn.lock if using Yarn), then reinstall your dependencies.
4. ESM-related issues: Nuxt 3 uses ES Modules, which can sometimes cause issues. As mentioned in the ES Modules troubleshooting guide (https://nuxt.com/docs/guide/concepts/esm#troubleshooting-esm-issues), you might need to transpile certain libraries or alias them to their CommonJS versions if they're not properly supporting ESM.
5. Node.js version: Ensure you're using a compatible Node.js version. Nuxt 3 requires Node.js 14.16.0 or later, preferably the latest LTS version.
To troubleshoot this issue, you can try the following steps:
1. Delete the
.nuxt
, node_modules
, and .output
directories, as well as the package-lock.json
or yarn.lock
file.
2. Ensure you're using the latest LTS version of Node.js.
3. Reinstall your dependencies with npm install
or yarn install
.
4. Try running the development server again with npm run dev
or yarn dev
.
If the issue persists, you might want to check if there are any known issues with the nuxthub
package you installed. It's possible that this package is causing conflicts with the core Nuxt functionality.
If none of these steps resolve the issue, you may want to create a minimal reproduction of the problem and report it as a bug to the Nuxt GitHub repository (https://nuxt.com/docs/community/reporting-bugs#figure-out-what-the-cause-might-be).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@173158033742888961> Kapa.ai is still learning and improving, please let me know how I did by reacting below.
Here's my package.json:
Solved it by doing a clean install... Weird.