Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running lerna bootstrap with node_modules doesn't update lockfile #1883

Closed
tanhauhau opened this issue Jan 22, 2019 · 5 comments
Closed

Running lerna bootstrap with node_modules doesn't update lockfile #1883

tanhauhau opened this issue Jan 22, 2019 · 5 comments

Comments

@tanhauhau
Copy link
Contributor

Steps to Reproduce (for bugs)

  1. lerna bootstrap
  2. remove a external dependency from package.json for 1 of the package
  3. lerna bootstrap again
  4. nothing happens

Expected Behavior

  • remove the dependency from node_modules/
  • update yarn.lock or package-lock.json

Current Behavior

  • nothing happens

Possible Solution

lerna.json

<!-- Please paste your `lerna.json` here -->

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Context

Your Environment

Executable Version
lerna --version 3.4.3
npm --version 6.6.0
yarn --version 1.12.3
node --version v8.12.0
OS Version
NAME VERSION
@tanhauhau tanhauhau mentioned this issue Jan 22, 2019
9 tasks
@evocateur
Copy link
Member

From the root node_modules? Please post your lerna.json and the exact command you ran.

@tanhauhau
Copy link
Contributor Author

you can reproduce with this setup:
https://github.com/tanhauhau/repro-lerna-bootstrap

  1. lerna bootstrap
  2. you should be able to install everything into respective node_modules after lerna bootstrap
  3. switch to remove-find-pkg branch, the only difference here is that I manually remove a external dependency in @test/package-1's package.json, because there's no lerna remove command.
  4. run lerna bootstrap -> and nothing happened

Expected behaviour

  • remove the dependency from node_modules
  • update the yarn.lock file

@tanhauhau
Copy link
Contributor Author

I realise that if all dependencies are satisfied, lerna will not do anything, but what if there's extraneous dependencies? it would be good if we can have a way to npm prune / yarn install that will optimise/remove extraneous package in the node_modules and update the lock file, yet still maintain the symlink within local dependencies.

@tanhauhau
Copy link
Contributor Author

After reading through the other issues, I guess the better long term solution is to have lerna remove, I've created an issue for that: #1886

@evocateur
Copy link
Member

Gonna close this in favor of #1886, then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants