title: npm/yarn module install with git: cloning repo into node_modules and installing does not work but yarn add does
body: <p>I'm trying to make a contribution to an opensource project. In particular, react-native. </p>
  
  <p>I have a test app which I've created with <code>create-react-native-app test</code> if I do the following:</p>
  
  <pre><code>cd test
  rm -rf node_modules/react-native
  yarn add https://github.com/&lt;mygithub&gt;/react-native # (my fork)
  </code></pre>
  
  <p>There's no issue when I start my app with <code>yarn run ios</code></p>
  
  <p>However, if I try to clone my fork into node_modules and install it manually with the following:</p>
  
  <pre><code>cd test
  rm -rf node_modules/react-native
  git clone https://github.com/&lt;mygithub&gt;/react-native
  cd react-native
  yarn install
  </code></pre>
  
  <p>I get all sorts of issues. Namely, in my case:</p>
  
  <pre><code>console.error: "React Native version mismatch. 
  JavaScript version: 0.0.0
  Native version: 0.52.0
  ...
  </code></pre>
  
  <p>Which to me indicates that something in cloning and manually installing is done differently than adding the package with <code>yarn install</code> and a github url.</p>
  
  <p>I want to be able to work out of a git repo to commit my work and if I use yarn install it is not an initialized git repo. For lack of a better solution, how can I get manually cloning and installing a node_module with yarn to yield the same result as adding it with yarn install?</p>
  
  <p>Edit to add steps attempted for yarn-link:</p>
  
  <pre><code>git clone https://github.com/&lt;mygithub&gt;/react-native
  cd react-native
  yarn install
  yarn link
  cd ../test
  yarn link "react-native"
  </code></pre>
  
  <p>This results in the same results as cloning my fork into test/node_modules.</p>
  
  <p>Edit 2: I should add, according the the react-native docs, I should be able to install my fork by cloning it into my project's node_modules folder and installing. The only difference is that I'm using yarn. 
  <a href="https://facebook.github.io/react-native/docs/android-building-from-source.html#building-the-source" rel="nofollow noreferrer">https://facebook.github.io/react-native/docs/android-building-from-source.html#building-the-source</a></p>