我正在尝试使用 lucia 实现用户名和密码登录,就像在 lucia 教程中一样,我使用 @node-rs/argon2 来哈希密码,但我收到此错误:
Error: The specified module could not be found. ?\D:\Coding\social_app\node_modules@node-rs\argon2-win32-x64-msvc\argon2.win32-x64-msvc.node
我的 next.config.mgs
/** @type {import('next').NextConfig} */
const nextConfig = {
serverExternalPackages: ['@node-rs/argon2'],
};
export default nextConfig;
我尝试重新安装所有依赖项,将节点和 npm 更新到最新版本,但没有帮助。 Next.js 版本 15.0.0-rc.0.
这对我有用(下一个 v14.2.7)
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
serverComponentsExternalPackages: ["@node-rs/argon2"],
},
};
export default nextConfig;