Skip to content

Add yarn preinstall script

What does this MR do and why?

Add yarn preinstall script

Yarn seems to have problems at times, if one uses an <alias>@npm:<name> and those packages are being updated. In case one switches branches the node_modules folder seems to end up being a corrupted somehow. So we add a simple script which forcefully removed node_modules.

See also: !130678 (merged)

Screenshots or screen recordings

N/A

How to set up and validate locally

  1. yarn install
  2. yarn install, nothing should happen
  3. Change e.g. the version in package.json from "sentrybrowser": "npm:@sentry/browser@^7.21.1" to "sentrybrowser": "npm:@sentry/browser@^7.66.0"
  4. yarn install should print a warning and remove node_modules before install

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Lukas 'ai-pi' Eipert

Merge request reports