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 lerna init
, and my current setup looks like this:
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"
}
My understanding was that lerna bootstrap
at this point is supposed to locate package1
in the project and symlink it to prior-existing-project
's /node_modules/new-refactored-package/
. From lerna's readme:
Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies.
When run, this command will:
- npm install all external dependencies of each package.
- Symlink together all Lerna packages that are dependencies of each other.
- npm prepublish all bootstrapped packages.
However, when I run it, lerna attempts instead to npm install new-refactored-package
:
npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/new-refactored-package
Am I misunderstanding? Do I first have to publish the depended-upon packages to npm
?