Cannot find module 'argon2/lib/binding/napi-v3/argon2.node'
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
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 devDescribe the bug
The console prints the error below, and when visiting the webpage it returns
503 Server Unavailableand 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 fromnuxt.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.