deasync icon indicating copy to clipboard operation
deasync copied to clipboard

Can't build because `node-gyp` missing

Open nicholaschiang opened this issue 2 years ago • 3 comments

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.

nicholaschiang avatar Oct 26 '21 17:10 nicholaschiang

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)

leaumar avatar Nov 10 '21 18:11 leaumar

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.

prgTW avatar Oct 30 '22 15:10 prgTW

See this for a solution and workaround:

  • https://github.com/abbr/deasync/issues/181

trusktr avatar Oct 21 '23 06:10 trusktr