lerna
lerna copied to clipboard
bootstrap removes "optional": true from package-lock.json
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)
mkdir lerna-repo && cd $_npx lerna init(cd packages && npx create-react-app client)(cd packages/client && rm -r node_modules)npm installnpx 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 |
Same here, and it will install all optionalDenpendencies after npm i --no-optional
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.
I have the same problem (lerna 3.14.1). Any plans to change this behavior?
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 🙏