Getting `Error: Cannot find module '@node-rs/argon2-linux-arm64-gnu'` and `'./argon2.linux-arm64-gnu.node'` error
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Bắt đầu với logic tải native trong node_modules/@node-rs/argon2/index.js và entry .next/server/app/(main)/(auth)/signin/page.js đã triển khai được hiển thị trong stack trace. Tái hiện lỗi với các thiết lập triển khai Node.js, Next.js, Docker và AWS được liệt kê; hoàn tất khi API hashing và verification đã triển khai tải được native binding Linux ARM64 cần thiết mà không gặp MODULE_NOT_FOUND.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Here are some of the dependencies I use.
- Next.js:
^14.2.4, - @node-rs/argon2:
^1.8.3 - node:
18.17.1and20.12.2(tried both) - macOS M2 Pro, Sonoma 14.2.1
Build / deploy using both AWS Cloudfront or Docker container
I switched over to using node-rs/argon2 package since the oslo/password package was causing dev error.
If I use node-rs/argon2 package:
import { hash, verify } from '@node-rs/argon2'
...
export async function encryptPassword(password: string): Promise<string> {
return await hash(password, {
memoryCost: 19456,
timeCost: 2,
outputLen: 32,
parallelism: 1,
})
}
export async function verifyPassword(
password: string,
hashedPassword: string,
): Promise<boolean> {
return await verify(hashedPassword, password, {
memoryCost: 19456,
timeCost: 2,
outputLen: 32,
parallelism: 1,
})
}
Error
After building Next.js and deploying it either using AWS Cloudfront or just containerize the app with Docker and running it, the api the handles the hashing and verifying fails with the following error:
Error: Failed to load native binding
at Object.<anonymous> (/var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js:359:11)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
at Module.load (node:internal/modules/cjs/loader:1203:32)
at Module._load (node:internal/modules/cjs/loader:1019:12)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at mod.require (/var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:177:18)
at 82406 (/var/task/.next/server/app/(main)/(auth)/signin/page.js:1:81)
at t (/var/task/.next/server/webpack-runtime.js:1:128) {
digest: '903678548',
[cause]: [
Error: Cannot find module './argon2.linux-arm64-gnu.node'
Require stack:
- /var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js
- /var/task/.next/server/app/(main)/(auth)/signin/page.js
- /var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require.js
- /var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at /var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:55:36
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at mod.require (/var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:177:18)
at requireNative (/var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js:237:16)
at Object.<anonymous> (/var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js:332:17)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [Array]
},
Error: Cannot find module '@node-rs/argon2-linux-arm64-gnu'
Require stack:
- /var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js
- /var/task/.next/server/app/(main)/(auth)/signin/page.js
- /var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require.js
- /var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/next-server.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1140:15)
at /var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:55:36
at Module._load (node:internal/modules/cjs/loader:981:27)
at Module.require (node:internal/modules/cjs/loader:1231:19)
at mod.require (/var/task/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected]/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:177:18)
at requireNative (/var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js:242:16)
at Object.<anonymous> (/var/task/node_modules/.pnpm/@[email protected]/node_modules/@node-rs/argon2/index.js:332:17)
at Module._compile (node:internal/modules/cjs/loader:1364:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1422:10) {
code: 'MODULE_NOT_FOUND',
requireStack: [Array]
}
]
}
Can't figure out why this is. Has there been any hacks or fixes for this issue?
- Ngôn ngữ chính
- Rust
- Star
- 1.5k
- Fork
- 52
- Merge trung bình
- 1 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 14
Chuẩn bị môi trường
Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của napi-rs/node-rs
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
napi-rs/node-rs#1009 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 45/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[node-rs/jieba, lunr.zh error] top-level await is not available in the configured target environmentĐang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của napi-rs/node-rs
Issue tương tự
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiCó thể đã có người làm @arvindkumar-ship-it đã nhận hôm nay. Đang mởllm translation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
BerriAI/litellm#51871 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
comp-formats
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 64/100
ClickHouse/ClickHouse#131694 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
C-Bug S-Needs-Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
bevyengine/bevy#26558 ·
Maintainer thường phản hồi trong vòng 2 ngày