question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

nuxt/bridge - cannot find module 'nuxt' at startup

See original GitHub issue

Environment

  • Operating System: Darwin
  • Node Version: v16.15.1
  • Nuxt Version: 2.16.0-27610581.123206cb
  • Package Manager: npm@8.11.0
  • Builder: webpack
  • User Config: alias, head, css, plugins, components, buildModules, modules, i18n, axios, build, publicRuntimeConfig, privateRuntimeConfig, bridge
  • Runtime Modules: @nuxtjs/axios@5.13.6, @nuxtjs/auth-next@5.0.0-1641536721.10cfcc9, @nuxtjs/i18n@7.2.2
  • Build Modules: @nuxtjs/eslint-module@3.1.0, @pinia/nuxt@0.1.9, @nuxt/bridge@3.0.0-27611430.cf4761a

Reproduction

https://github.com/kadlinobit/djspot-fe/tree/vuex-to-pinia Branch: vuex-to-pinia

Describe the bug

After fresh installation, when running dev server (nuxi dev) there is an error:

 ERROR  Cannot start nuxt:  Cannot find module 'nuxt'                                                                                     19:47:24
Require stack:
- /Users/kadlec/projects/djspot-fe/index.js

  Require stack:
  - index.js
  at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
  at Function.resolve (node:internal/modules/cjs/helpers:108:19)
  at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:108226)
  at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:276:29)
  at importModule (node_modules/@nuxt/kit/dist/index.mjs:299:24)
  at loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:690:92)
  at async load (node_modules/@nuxt/bridge/node_modules/nuxi/dist/chunks/dev.mjs:6740:23)
  at async Object.invoke (node_modules/@nuxt/bridge/node_modules/nuxi/dist/chunks/dev.mjs:6786:5)
  at async _main (node_modules/@nuxt/bridge/node_modules/nuxi/dist/cli.mjs:46:20)

Additional context

No response

Logs

Nuxt CLI v3.0.0-rc.4                                                                                                                      19:47:24
                                                                                                                                          19:47:24
  > Local:    http://localhost:3000/ 
  > Network:  http://192.168.0.102:3000/


 ERROR  Cannot start nuxt:  Cannot find module 'nuxt'                                                                                     19:47:24
Require stack:
- /Users/kadlec/projects/djspot-fe/index.js

  Require stack:
  - index.js
  at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
  at Function.resolve (node:internal/modules/cjs/helpers:108:19)
  at Function._resolve [as resolve] (node_modules/jiti/dist/jiti.js:1:108226)
  at resolveModule (node_modules/@nuxt/kit/dist/index.mjs:276:29)
  at importModule (node_modules/@nuxt/kit/dist/index.mjs:299:24)
  at loadNuxt (node_modules/@nuxt/kit/dist/index.mjs:690:92)
  at async load (node_modules/@nuxt/bridge/node_modules/nuxi/dist/chunks/dev.mjs:6740:23)
  at async Object.invoke (node_modules/@nuxt/bridge/node_modules/nuxi/dist/chunks/dev.mjs:6786:5)
  at async _main (node_modules/@nuxt/bridge/node_modules/nuxi/dist/cli.mjs:46:20)

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:11
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
AndreyYolkincommented, Jul 4, 2022

Just updated to RC4 and noticed


  "devDependencies": {
    "nuxt": "3.0.0-rc.4"
  },

used to be “nuxt3”: “latest”

Also change the top line in nuxt.config.ts to import { defineNuxtConfig } from 'nuxt' instead of nuxt3

Author used nuxt 2 with bridge, which does not have nuxt3 or rc packages. But I got the same error yesterday in my nuxt2b app

1reaction
kadlinobitcommented, Jul 10, 2022

I came back after vacation, tried fresh npm install again and the problem disappeared.

Probably thanks to a new nuxt bridge version, this is my new nuxi info output:

- Operating System: `Darwin`
- Node Version:     `v16.15.1`
- Nuxt Version:     `2.16.0-27616340.013f051b`
- Package Manager:  `npm@8.11.0`
- Builder:          `webpack`
- User Config:      `alias`, `head`, `css`, `plugins`, `components`, `buildModules`, `modules`, `i18n`, `axios`, `auth`, `build`, `publicRuntimeConfig`, `privateRuntimeConfig`, `serverHandlers`, `devServerHandlers`, `bridge`
- Runtime Modules:  `@nuxtjs/axios@5.13.6`, `@nuxtjs/auth-next@5.0.0-1641536721.10cfcc9`, `@nuxtjs/i18n@7.2.2`
- Build Modules:    `@nuxtjs/eslint-module@3.1.0`, `@pinia/nuxt@0.1.9`, `@nuxt/bridge@3.0.0-27621666.ee600b4`

Previous nuxt bridge version: 3.0.0-27611430.cf4761a Current nuxt bridge version: 3.0.0-27621666.ee600b4

Read more comments on GitHub >

github_iconTop Results From Across the Web

cannot find module 'nuxt' at startup · Issue #380 · nuxt/bridge
I came back after vacation, tried fresh npm install again and the problem disappeared. Probably thanks to a new nuxt bridge version, this...
Read more >
Error: Cannot find module nuxt.js, why my app don't start?
Try and install nuxt-start package. This is what I used to solve a very similar challenge (On Production).
Read more >
@nuxt/bridge-edge - npm
Bridge is a forward-compatibility layer that allows you to experience many of the new Nuxt 3 features by simply installing and enabling a...
Read more >
Migrate to Bridge: Overview - Nuxt
Bridge is a forward-compatibility layer that allows you to experience many of the new Nuxt 3 features by simply installing and enabling a...
Read more >
cannot find module '@vue/composition-api' - You.com
Create simple application via yarn create nuxt-app; Add devDependencies via yarn add -D @nuxtjs/composition-api and add this dependency to buildModules in nuxt.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found