title: Using Lerna with unpublished packages
body: <p>I'm trying to set up my monorepo with Lerna. The plan is to refactor an existing project by pulling chunks of code out which should be their own packages. I've run <code>lerna init</code>, and my current setup looks like this:</p>
  
  <pre><code>project/
    packages/
      new-refactored-package/
        package.json
      prior-existing-project/
        package.json
          { "dependencies" : { "new-refactored-package" : "latest" } }
    package.json
      {
        "devDependencies": {
          "lerna": "^2.0.0-rc.5"
        }
      }
    lerna.json
      {
        "lerna": "2.0.0-rc.5",
        "packages": [
          "packages/*"
        ],
        "version": "0.0.0"
      }
  </code></pre>
  
  <p>My understanding was that <code>lerna bootstrap</code> at this point is supposed to locate <code>package1</code> in the project and symlink it to <code>prior-existing-project</code>'s <code>/node_modules/new-refactored-package/</code>. From <a href="https://www.npmjs.com/package/lerna#bootstrap" rel="noreferrer">lerna's readme</a>:</p>
  
  <blockquote>
    <p>Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies.</p>
    
    <p>When run, this command will:</p>
    
    <ul>
    <li>npm install all external dependencies of each package.</li>
    <li><strong>Symlink together all Lerna packages that are dependencies of each other.</strong></li>
    <li>npm prepublish all bootstrapped packages.</li>
    </ul>
  </blockquote>
  
  <p>However, when I run it, lerna attempts instead to <code>npm install new-refactored-package</code>:</p>
  
  <blockquote>
    <p>npm ERR! 404 Registry returned 404 for GET on <a href="https://registry.npmjs.org/new-refactored-package" rel="noreferrer">https://registry.npmjs.org/new-refactored-package</a></p>
  </blockquote>
  
  <p>Am I misunderstanding? Do I first have to publish the depended-upon packages to <code>npm</code>?</p>