title: How do I force Yarn to reinstall a package?
body: <p>My project has a dependency that I sometimes get from a package server and sometimes get from a local copy I have on my machine. As a result, I frequently need to have Yarn switch where it looks for the dependency. Furthermore, I often change the local copy of the dependency and need to see that change reflected in my main project. As a result, I need a way to tell Yarn to continue looking at the same location for the dependency, but to reinstall the dependency, skipping the cache and grabbing it directly from its current source, even when the version number hasn't changed. (Sometimes I want try small changes to the dependency, and updating the version number every time would quickly become annoying.)</p>
  
  <p>How do I do so?</p>
  
  <p>I've tried the following, but none of them work:</p>
  
  <pre><code>yarn remove dependency
  yarn add file:/dependency
  </code></pre>
  
  <p>Continues to use the previous version of the dependency.</p>
  
  <pre><code>yarn remove dependency
  yarn cache clear
  yarn add file:/dependency
  yarn install --force
  </code></pre>
  
  <p>Also continues to use the previous version of the dependency.</p>
  
  <pre><code>yarn remove dependency
  rm -rf node_modules/
  yarn cache clear
  yarn add file:/dependency
  yarn install --force
  </code></pre>
  
  <p>Still continues to use the previous version of the dependency.</p>
  
  <p>How can I ensure that Yarn is using the latest version of my dependency?</p>