Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build because node-gyp missing #155

Open
nicholaschiang opened this issue Oct 26, 2021 · 3 comments
Open

Can't build because node-gyp missing #155

nicholaschiang opened this issue Oct 26, 2021 · 3 comments

Comments

@nicholaschiang
Copy link

nicholaschiang commented Oct 26, 2021

When installing this package ([email protected]) using Yarn v2 on Mac OS X with Node.js 16.13.0 I get this error:

This file contains the result of Yarn building a package (deasync@npm:0.1.21)
Script name: install

Usage Error: Couldn't find a script name "node-gyp" in the top-level (used by deasync@npm:0.1.21). This typically happens because some package depends on "node-gyp" to build itself, but didn't list it in their dependencies. To fix that, please run "yarn add node-gyp" into your top-level workspace. You also can open an issue on the repository of the specified package to suggest them to use an optional peer dependency.

$ yarn run [--inspect] [--inspect-brk] <scriptName> ...

Build failed

To fix this, you should probably list node-gyp in your peerDependencies.

@leaumar
Copy link

leaumar commented Nov 10, 2021

Also breaks the build of deasync (for parcel-bundler) on gitlab CI in a nodejs 17 docker image. Please follow up on this issue.

I thought adding this to yarnrc would be a viable workaround, since the error explains it just boils down to node-gyp missing, but nothing changes:

packageExtensions:
  deasync@*:
    peerDependencies:
      node-gyp: latest

(I also tried with dependencies instead of peerDependencies)

@prgTW
Copy link

prgTW commented Oct 30, 2022

FWIW I've managed to install my dependencies on alpine v3.16 and node v18 after running the following:

sudo apk add --no-cache python3 g++

I doubt that installing build essentials is, or should be, necessary, but I'm totally not a frontend dev so just wanted to share my observation.

@trusktr
Copy link

trusktr commented Oct 21, 2023

See this for a solution and workaround:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants