arei / npmbox

Utility for creating (boxing) and using (unboxing) an archive of a complete (including all dependencies) npm install.
MIT License
245 stars 34 forks source link

New `npmunbox` option: `--scripts` #79

Closed danfuzz closed 7 years ago

danfuzz commented 7 years ago

I noticed that npmunbox runs the underlying npm install with scripts disabled. I'm guessing this was done because it's common for scripts to try to use the network. However, I'd at least like the option of letting scripts run.

I suggest adding a --scripts option which would let this happen.

danfuzz commented 7 years ago

Fixed in v4.2.0, just published.

dtgriscom commented 7 years ago

I'm a little confused about this option, or rather that the default has been not to run scripts. About 1% of scripts in an extremely un-scientific sampling depend on the "install" script to finish installation, which means the default npmunbox command would fail, perhaps subtly, in these situations. Examples I found: dtrace-provider, and snmpjs.

What would the downside be to run scripts on unboxing by default?

danfuzz commented 7 years ago

Speaking as the original reporter, I'd be perfectly happy if the default were changed. I made the request as stated, though, because not running scripts is the status quo and so it would be a backward-incompatible change in behavior. That said, maybe it's reasonable to switch the default as long as it's done with a major version bump.

dtgriscom commented 7 years ago

I'll file this as a feature request, and we'll see if the lead developer objects.