nwutils / nw-builder

Build NW.js applications for Linux, MacOS and Windows
MIT License
1.68k stars 302 forks source link

postinstall script fails because of missing base-volta-off-of-nwjs #1131

Closed thisjt closed 2 months ago

thisjt commented 2 months ago

Issue Type

Current/Missing Behaviour

I am getting this error when I attempt to update to 4.7.6. image

Expected/Proposed Behaviour

postinstall script will run without issues after updating

Additional Info

TheJaredWilcurt commented 2 months ago

This is because you are installing it as a devDependency, and devDependencies do not install their devDependency, so it is trying to run a post-install script referencing a node module that was skipped.

I designed base-volta-off-of-nwjs to be ran via npx, so this kind of thing wouldn't happen, but also, I hadn't considered its use with a library, rather than a desktop app.

Perhaps changing to a different npm hook would work better. I don't know which one (if any) is better though:

@ayushmanchhabra You'd want something that runs locally for development, but isn't ran when installed as a dependency when published.

TheJaredWilcurt commented 2 months ago

This repo could create a postinstall.js script that checks if node_modules/.bin/base-volta-off-of-nwjs exists, and if so, runs it. Then change the package.json to "postinstall": "node ./scripts/postinstall.js". That's the only solution I can think of to work around this.

thisjt commented 2 months ago

Confirmed fixed in 4.7.7. Thanks! image