logoalt Hacker News

voidUpdatetoday at 1:59 PM2 repliesview on HN

One thing I've never understood is why NPM allows packages to run code immediately after they are installed. What's the use case for that? A package should just be some code you can call on at runtime


Replies

tom1337today at 2:05 PM

Some packages need to build native dependencies. sharp for example needs to build libvips on the system [0] to work

0: https://github.com/lovell/sharp/blob/main/install/build.js

show 2 replies
mark_l_watsontoday at 2:46 PM

I turn off running scripts on installation. So far, no inconveniences.