lerna icon indicating copy to clipboard operation
lerna copied to clipboard

bootstrap removes "optional": true from package-lock.json

Open mjgallag opened this issue 6 years ago • 3 comments

Expected Behavior

lerna bootstrap shouldn't remove "optional": true from package-lock.json.

Current Behavior

lerna bootstrap removes "optional": true from package-lock.json.

Steps to Reproduce (for bugs)

  1. mkdir lerna-repo && cd $_
  2. npx lerna init
  3. (cd packages && npx create-react-app client)
  4. (cd packages/client && rm -r node_modules)
  5. npm install
  6. npx lerna bootstrap
lerna.json

{
  "packages": [
    "packages/*"
  ],
  "version": "0.0.0"
}

Context

Your Environment

Executable Version
lerna --version 3.13.4
npm --version 6.9.0
node --version 10.15.3
OS Version
macOS Mojave 10.14.4

mjgallag avatar May 04 '19 18:05 mjgallag

Same here, and it will install all optionalDenpendencies after npm i --no-optional

xuchaoying avatar May 06 '19 11:05 xuchaoying

Yes, this is because the entire package.json is mangled horribly when lerna bootstrap chugs through them. I'm fairly certain there are many other issues in this repo about this behavior.

evocateur avatar May 14 '19 23:05 evocateur

I have the same problem (lerna 3.14.1). Any plans to change this behavior?

jonasjacek avatar Sep 09 '19 09:09 jonasjacek

Hi Folks 👋

Please take a look at our published roadmap for Lerna v7 here: https://github.com/lerna/lerna/discussions/3410

One of the key items covered at length on there (please do read it for full context) is that now that we find ourselves in late 2022, it no longer makes sense for lerna to supplement package management concerns (such as installation, boostrapping, linking etc) which are covered reliably for monorepo workspaces by the three main package managers: npm, yarn and pnpm. lerna bootstrap et al were developed in completely different era of the JavaScript ecosystem.

If you have any specific concerns please do join in on that discussion, and provide as much context as possible.

Many thanks 🙏

JamesHenry avatar Nov 29 '22 13:11 JamesHenry