hetrodoo / node-hide-console-window

MIT License
19 stars 7 forks source link

Doesn't work with bun #10

Closed KDot227 closed 7 months ago

KDot227 commented 7 months ago

When trying to install with bun I get the following error

bun add v1.0.32-canary.21 (5fec71bd)

 installed node-hide-console-window@2.2.0

 1 package installed [360.00ms]

 Blocked 1 postinstall. Run `bun pm untrusted` for details.
1 | const {showConsole, hideConsole} = require("./build/Release/node-hide-console-window");
                                               ^
error: Could not resolve: "./build/Release/node-hide-console-window"
    at C:\Users\this1\Desktop\Software\Software\Bat2Exe\src\node_modules\node-hide-console-window\index.js:1:44
hetrodoo commented 7 months ago

This package was not intended for use with Bun, and I have no experience with it. If you have any ideas on why it does not work, feel free to create a PR.

hetrodoo commented 7 months ago

Take a look at this doc (it was the first result on google search), it says: Bun does not execute arbitrary lifecycle scripts for installed dependencies, such as postinstall and node-gyp builds.

To tell Bun to allow lifecycle scripts for a particular package, add the package to trustedDependencies in your package.json.

Package.json

{
  "name": "my-app",
  "version": "1.0.0",
  "trustedDependencies": ["node-hide-console-window"]
}

https://bun.sh/guides/install/trusted