Given an npm workspace with the following structure
workspace
package.json
packages
package-a
package.json
package-b
package.json
When I run an install command in package-a this will generate a package-lock.json file in the root of the workspace but not in the package.json file itself.
Is there a way to also generate it in the packages?
Yes, it is possible for example like this:
npm i emoji-picker-react -w packages/deepcase
This command updates packages/deepcase/package.json and package-lock.json in root folder.
(cd packages/deepcase && npm i --package-lock-only --workspaces false)
This command updates packages/deepcase/package-lock.json.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With