sidebase / nuxt-auth

Authentication built for Nuxt 3! Easily add authentication via OAuth providers, credentials or Email Magic URLs!
https://auth.sidebase.io
MIT License
1.32k stars 165 forks source link

yarn dev get failed but pnpn run dev works #648

Open alokVishu opened 10 months ago

alokVishu commented 10 months ago

Environment

Working directory: /Users/aloksoni/Downloads/my-sidebase-venture 6:43:27 PM Nuxt project info: (copied to clipboard) 6:43:27 PM


πŸ‘‰ Report an issue: https://github.com/nuxt/nuxt/issues/new 6:43:27 PM

πŸ‘‰ Suggest an improvement: https://github.com/nuxt/nuxt/discussions/new

πŸ‘‰ Read documentation: https://nuxt.com

Reproduction

No response

Describe the bug

When attempting to install sidebase/marino and selecting only nuxt-auth with the yarn package manager, an error is encountered and the project will not run. However, using the pnpm package manager results in a successful installation.

Additional context

No response

Logs

β„Ή nuxt-auth setup starting                                                                                                                                                              sidebase-auth 6:42:04 PM
β„Ή Selected provider: authjs. Auth API location is /api/auth, ensure that NuxtAuthHandler({ ... }) is there, see https://sidebase.io/nuxt-auth/configuration/nuxt-auth-handler           sidebase-auth 6:42:04 PM
βœ” nuxt-auth setup done                                                                                                                                                                  sidebase-auth 6:42:04 PM
  ➜ DevTools: press Shift + Option + D in the browser (v1.0.8)                                                                                                                                         6:42:04 PM

 WARN  "next-auth/providers/github" is imported by "server/api/auth/[...].ts", but could not be resolved – treating it as an external dependency.                                                      6:42:06 PM

 WARN  "next-auth/providers/credentials" is imported by "server/api/auth/[...].ts", but could not be resolved – treating it as an external dependency.                                                 6:42:06 PM

β„Ή Vite server warmed up in 1482ms                                                                                                                                                                     6:42:06 PM
β„Ή Vite client warmed up in 1606ms                                                                                                                                                                     6:42:06 PM

 WARN  "next-auth/core" is imported by "node_modules/@sidebase/nuxt-auth/dist/runtime/server/services/authjs/nuxtAuthHandler.mjs", but could not be resolved – treating it as an external dependency.  6:42:06 PM

 WARN  "next-auth/jwt" is imported by "node_modules/@sidebase/nuxt-auth/dist/runtime/server/services/authjs/nuxtAuthHandler.mjs", but could not be resolved – treating it as an external dependency.   6:42:06 PM

βœ” Nitro built in 775 ms                                                                                                                                                                         nitro 6:42:06 PM

 ERROR  [worker reload] [worker init] Cannot find package 'next-auth' imported from /Users/aloksoni/Downloads/my-sidebase-venture/.nuxt/dev/index.mjs                                                  6:42:06 PM

  at __node_internal_captureLargerStackTrace (node:internal/errors:497:5)
  at new NodeError (node:internal/errors:406:5)
  at packageResolve (node:internal/modules/esm/resolve:789:9)
  at moduleResolve (node:internal/modules/esm/resolve:838:20)
  at defaultResolve (node:internal/modules/esm/resolve:1043:11)
  at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:383:12)
  at ModuleLoader.resolve (node:internal/modules/esm/loader:352:25)
  at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:228:38)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
  at link (node:internal/modules/esm/module_job:84:36)
phoenix-ru commented 9 months ago

Have you installed next-auth alongside this module?

https://sidebase.io/nuxt-auth/getting-started/installation#specifics-authjs-provider

Or do you mean that merino starter does not do so by default?

alokVishu commented 9 months ago

@phoenix-ru yes, by default.