readium / r2-shared-js

Shared models for Readium Desktop
BSD 3-Clause "New" or "Revised" License
11 stars 11 forks source link

Installation fails in v1.0.71 when installing without dev dependencies #57

Closed jspizziri closed 2 months ago

jspizziri commented 5 months ago

This commit introduced a postinstall command. That command depends on rimraf which is listed as a devDependency. This causes an install failure when attempting to install this package without the devDependencies which would be traditional in a production build.

danielweck commented 5 months ago

well spotted, thank you very much for letting us know. ironically, the offending npm package is deleted because of build-time errors, it is not problematic at runtime. instead of moving rimraf to devdeps, I am wondering whether we could just capture a non-zero exit code and fallback gracefully to a co-op (e.g. || echo noop)

danielweck commented 5 months ago

ps: ultimately, the better fix would be to remove this postinstall workaround, and instead swap the antiquated ava dependency for vitest or another modern test runner {I believe types/glob is a transitive dep via ava)

AntonOfTheWoods commented 2 months ago

BTW, this also causes installing with pnpm to fail, and as a result makes using this library extremely inconvenient in many situations where network is an issue, due to npm being fundamentally broken...

danielweck commented 2 months ago

Sorry this took so long to fix. Hopefully this works:

https://github.com/readium/r2-shared-js/commit/57549fd198ddb2d00ae2437947c3b8cdfa24471c

AntonOfTheWoods commented 2 months ago

Thanks @danielweck , pnpm is now able to install the package just fine!