question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running lerna bootstrap does not install all dependencies

See original GitHub issue

Expected Behavior

When running lerna bootstrap all dependencies should be install in packages.

Current Behavior

If I run lerna bootstrap and then run lerna start to start all my clients and packages, I get the following error:

@raisalholdings/raisal-ui:    2263 modules
@raisalholdings/raisal-ui: ERROR in ../raisal-utils/src/reduxUtils.js
@raisalholdings/raisal-ui: Module not found: Error: Can't resolve 'redux-actions' in '/Users/scott/Develop/Raisal/2.0/raisal-clients/packages/raisal-utils/src'
@raisalholdings/raisal-ui: ERROR in ../raisal-utils/src/reduxUtils.js
@raisalholdings/raisal-ui: Module not found: Error: Can't resolve 'redux-optimistic-ui' in '/Users/scott/Develop/Raisal/2.0/raisal-clients/packages/raisal-utils/src'

If I cd into packages/raisal-ui, and run yarn, I get the following error:

error An unexpected error occurred: "ENOENT: no such file or directory, lstat '/Users/scott/Develop/Raisal/2.0/raisal-clients/packages/raisal-ui/node_modules/@raisalholdings/raisal-utils/node_modules/history/node_modules'".
...

But if I run yarn one more time, everything installs in raisal-ui and I can then run lerna run start and everything starts fine.

Possible Solution

Install all deps or provide logs to debug

I have the following setup:

root/
  clients/
  packages/
  lerna.json
  package.json

lerna.json

{
  "lerna": "2.5.1",
  "packages": [
    "clients/*",
    "packages/*"
  ],
  "npmClient": "yarn",
  "version": "2.1.13"
}

Your Environment

Executable Version
lerna --version 2.5.1
npm --version 6.0.0
yarn --version 1.6.0
node --version v8.9.3
OS Version
Sierra 10.13.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:95
  • Comments:66 (5 by maintainers)

github_iconTop GitHub Comments

148reactions
stale[bot]commented, Jan 17, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

104reactions
xpepermintcommented, Jun 23, 2018

Thanks @scottmcpherson! I also came to this simple workaround:

// package.json
{
  "scripts": {
    "bootstrap": "lerna exec npm install",
    "publish": "lerna publish --force-publish",
    "test": "lerna run test"
  },
  "devDependencies": {
    "lerna": "3.0.0-beta.21"
  }
}

So the lerna exec npm install command does the trick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Lerna bootstrap does not link local dependencies?
lerna bootstrap is supposed to link to packages that are already installed. the issue is that sometimes it doesn't link dependencies of ...
Read more >
@lerna/bootstrap - npm
Bootstrap the packages in the current Lerna repo. Installs all of their dependencies and links any cross-dependencies. When run, this command will:.
Read more >
FAQ | Lerna
For any packages that you add to your Lerna repository, instead of running npm install you should run lerna bootstrap . This will...
Read more >
lerna bootstrap - Fig.io
Options ; --hoist <glob>, Install external dependencies matching glob at the repo root so they're available to all packages ; --nohoist <glob>, Do...
Read more >
Untitled
When run, this command will: 1. `npm install` all external dependencies of each package. 2. Symlink together all Lerna `packages` that are dependencies...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found