Skip to content
This repository has been archived by the owner on Dec 12, 2023. It is now read-only.

Cannot find module 'argon2/lib/binding/napi-v3/argon2.node' #86

Open
waltkb opened this issue Aug 10, 2023 · 1 comment
Open

Cannot find module 'argon2/lib/binding/napi-v3/argon2.node' #86

waltkb opened this issue Aug 10, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@waltkb
Copy link

waltkb commented Aug 10, 2023

Environment

  • Operating System: Linux
  • Node Version: v20.5.0
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.5.2
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: devtools, modules
  • Runtime Modules: @sidebase/[email protected]
  • Build Modules: -

Reproduction

pnpx nuxi init
pnpm i -D @sidebase/nuxt-session
# add `modules: ['@sidebase/nuxt-session']` to `nuxt.config.ts`
pnpm dev

Describe the bug

The console prints the error below, and when visiting the webpage it returns 503 Server Unavailable and the error below:

ERROR  [worker reload] [worker init] Cannot find module '/home/user/IdeaProjects/nuxt-app/node_modules/.pnpm/[email protected]/node_modules/argon2/lib/binding/napi-v3/argon2.node'

Require stack:
- /home/user/IdeaProjects/nuxt-app/node_modules/.pnpm/[email protected]/node_modules/argon2/argon2.js

  Require stack:
  - node_modules/.pnpm/[email protected]/node_modules/argon2/argon2.js
  at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
  at Module._load (node:internal/modules/cjs/loader:901:27)
  at Module.require (node:internal/modules/cjs/loader:1115:19)
  at require (node:internal/modules/helpers:119:18)
  at Object.<anonymous> (node_modules/.pnpm/[email protected]/node_modules/argon2/argon2.js:9:25)
  at Module._compile (node:internal/modules/cjs/loader:1233:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
  at Module.load (node:internal/modules/cjs/loader:1091:32)
  at Module._load (node:internal/modules/cjs/loader:938:12)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:165:29)

This error does not occur when modules: ['@sidebase/nuxt-session'] is removed from nuxt.config.ts.

Additional context

No response

Logs

No response

@waltkb waltkb added the bug Something isn't working label Aug 10, 2023
@longstory0
Copy link

try

Environment

  • Operating System: Linux
  • Node Version: v20.5.0
  • Nuxt Version: 3.6.5
  • Nitro Version: 2.5.2
  • Package Manager: [email protected]
  • Builder: vite
  • User Config: devtools, modules
  • Runtime Modules: @sidebase/[email protected]
  • Build Modules: -

Reproduction

pnpx nuxi init
pnpm i -D @sidebase/nuxt-session
# add `modules: ['@sidebase/nuxt-session']` to `nuxt.config.ts`
pnpm dev

Describe the bug

The console prints the error below, and when visiting the webpage it returns 503 Server Unavailable and the error below:

ERROR  [worker reload] [worker init] Cannot find module '/home/user/IdeaProjects/nuxt-app/node_modules/.pnpm/[email protected]/node_modules/argon2/lib/binding/napi-v3/argon2.node'

Require stack:
- /home/user/IdeaProjects/nuxt-app/node_modules/.pnpm/[email protected]/node_modules/argon2/argon2.js

  Require stack:
  - node_modules/.pnpm/[email protected]/node_modules/argon2/argon2.js
  at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
  at Module._load (node:internal/modules/cjs/loader:901:27)
  at Module.require (node:internal/modules/cjs/loader:1115:19)
  at require (node:internal/modules/helpers:119:18)
  at Object.<anonymous> (node_modules/.pnpm/[email protected]/node_modules/argon2/argon2.js:9:25)
  at Module._compile (node:internal/modules/cjs/loader:1233:14)
  at Module._extensions..js (node:internal/modules/cjs/loader:1287:10)
  at Module.load (node:internal/modules/cjs/loader:1091:32)
  at Module._load (node:internal/modules/cjs/loader:938:12)
  at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:165:29)

This error does not occur when modules: ['@sidebase/nuxt-session'] is removed from nuxt.config.ts.

Additional context

No response

Logs

No response

try changing your package manager... I think is a dependency issue. Make sure to delete the node_modules and the lock files before doing a fresh install. this fixed it for me. I was using bun and switched to pnpm. but error will still be shown unless you delete the lock file and node modules. I hope this works for you.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants