next-learn icon indicating copy to clipboard operation
next-learn copied to clipboard

chapter6 vercel deploy error

Open zoushuhang0 opened this issue 1 year ago • 7 comments

Image

zoushuhang0 avatar Mar 10 '25 13:03 zoushuhang0

if you try running pnpm build on your local project, you should get a warning like:

Ignored build scripts: bcrypt.                                                           │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. 

As the warning suggests, run pnpm approve-builds and select bcrypt. Afterwards your package.json should be updated. Commit the new changes and push it to your Github and then try clicking deploy again on Vercel.

bevane avatar Mar 11 '25 04:03 bevane

if you try running pnpm build on your local project, you should get a warning like:

Ignored build scripts: bcrypt.                                                           │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. 

As the warning suggests, run pnpm approve-builds and select bcrypt. Afterwards your package.json should be updated. Commit the new changes and push it to your Github and then try clicking deploy again on Vercel.

This is supposed to work, but if it doesn't, you can try the other solution proposed in https://github.com/pnpm/pnpm/issues/9042#issuecomment-2638094544 The proposed solution is to manually add this option into your package.json file: "pnpm": { "onlyBuiltDependencies": [ "bcrypt" ] }

BenjamRuiz avatar Mar 14 '25 01:03 BenjamRuiz

I solve it by using ’ import from "bcryptjs" ‘ replace ’ import from "bcrypt" ‘

zoushuhang0 avatar Mar 18 '25 14:03 zoushuhang0

bcryptjs

Which file you made the change?

panditvijay avatar Mar 20 '25 08:03 panditvijay

bcryptjs

Which file you made the change?

you can search which file include import "bcrypt"

zoushuhang0 avatar Mar 20 '25 10:03 zoushuhang0

I had the same issue. I imported bcryptjs and removed bcrypt. This worked for me.

in the terminal write this

pnpm remove bcrypt
pnpm add bcryptjs

shihabhq avatar Mar 22 '25 17:03 shihabhq

if you try running pnpm build on your local project, you should get a warning like:

Ignored build scripts: bcrypt.                                                           │
│   Run "pnpm approve-builds" to pick which dependencies should be allowed to run scripts. 

As the warning suggests, run pnpm approve-builds and select bcrypt. Afterwards your package.json should be updated. Commit the new changes and push it to your Github and then try clicking deploy again on Vercel.

i didn't get any warning like this when trying to build locally but your solution did indeed work.

tbutman avatar Mar 23 '25 18:03 tbutman

https://github.com/vercel/next-learn/issues/1034

leerob avatar Apr 28 '25 15:04 leerob