vercel-builder: Error building bcrypt with node-gyp
I started to have this issues with nuxt/vercel-builder 0.17.12.
[4/5] Building fresh packages...
--
13:29:39.104 | error /vercel/workpath1/node_modules/bcrypt: Command failed.
13:29:39.104 | Exit code: 127
13:29:39.104 | Command: node-pre-gyp install --fallback-to-build
13:29:39.104 | Arguments:
13:29:39.104 | Directory: /vercel/workpath1/node_modules/bcrypt
13:29:39.104 | Output:
13:29:39.104 | /bin/sh: node-pre-gyp: command not found
13:29:39.105 | info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
13:29:40.019 | Error: Command "yarn install" exited with 127
13:29:42.852 | Done with "nuxt.config.js"
Seems, for some reason the bcrypt installation started to fail after version 0.17.7. I made a test today using this version, and the project builded successfully.
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 11
- Comments: 31 (5 by maintainers)
Commits related to this issue
- https://github.com/nuxt/vercel-builder/issues/371#issuecomment-804474999 — committed to brentnequin/vese-app by brentnequin 2 years ago
- fix https://github.com/nuxt/vercel-builder/issues/371\#issuecomment-804474999 — committed to vu3th/vue-dapp-starter by johnson86tw 2 years ago
- fix with https://github.com/nuxt/vercel-builder/issues/371\#issuecomment-1203975797 — committed to vu3th/vue-dapp-starter by johnson86tw 2 years ago
It worked for me! I’m using the
@supabase/supabase-jspackage that relies on node-gyp-build so myvercel-buildcommand looks likeyarn global add node-gyp-build.I think I found a workaround to the resolve this issue.
You can add
vercel-buildto yourpackage.jsonto global installnode-gyp, you’ll need to add abuildsstep before@nuxtjs/vercel-builderto ensure it gets installed in the correct order./bin/sh: node-pre-gyp: command not foundis still a problemyeah. Me too!
I added in an update to a similar issue I faced in #468 – I used
npminstead ofyarnand it worked (and I’m not sure why)For me the solution to add the pre build step doesn’t work. Wish we could get an answer from Nuxt or Vercel.
Any solution to this?
.vercelignoreseems to be only for “what files to exclude when uploading” and not “what files to exclude when building”. So it still tries to installbcryptwhich errors.I thought
.vercelignoreis applied after building and not before. I will try out.vercelignoreas it could be the solution to the problem. Thanks for the hint!I will try that and leave a response here within the next 2 hours.