abbr / deasync

Turns async function into sync via JavaScript wrapper of Node event loop
MIT License
972 stars 73 forks source link

Problem with node-gyp #181

Closed robingood556 closed 7 months ago

robingood556 commented 1 year ago

Error: deasync@npm:0.1.22 STDOUT Usage Error: Couldn't find a script name "node-gyp" in the top-level (used by deasync@npm:0.1.22). 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.

During installation step - "yarn install --immutable" My previous step - "npm -i -g node-gyp" and also i have g++, make packages

trusktr commented 1 year ago

Related:

This is specifically an issue with Yarn, not with Npm, because Yarn prevents bins from being in PATH if they are not an explicit dependency of a package.

To solve this, Yarn recommends that deasync should have node-gyp as a dependency in package.json. Here's a pull request for that:

As a workaround, you can put this inside of .yarnrc.yml:

packageExtensions:
    # deasync didn't add node-gyp as a direct dependency so it fails to build in
    # Yarn (https://github.com/yarnpkg/berry/issues/5804), so extend its
    # pkg.json config here.
    deasync@*:
        dependencies:
            node-gyp: 'latest'