Skip to content

Learn Next.js Chapter 6 setting up your database. Cannot find module bcrypt #76822

Answered by kappy713
mattybj69 asked this question in Help
Discussion options

You must be logged in to vote

Hi, I had the same problem, but I was able to build by switching to bcryptjs as Joseph suggested.

pnpm remove bcrypt
pnpm add bcryptjs

Don't forget to change /app/seed/route.ts to bcryptjs, as it uses bcrypt.

// /app/seed/route.ts
- import bcrypt from "bcrypt";
+ import bcrypt from "bcryptjs";

Replies: 5 comments 22 replies

Comment options

You must be logged in to vote
2 replies
@mattybj69
Comment options

@icyJoseph
Comment options

Comment options

You must be logged in to vote
20 replies
@IsaacDC
Comment options

@SylvainLeDEV
Comment options

@jianyun2020
Comment options

@Derrickkip
Comment options

@JuniorTak
Comment options

Answer selected by mattybj69
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet