--use-workspaces and npm
See original GitHub issueThe docs state that --use-workspaces
“enables integration with yarn workspaces”. However, it makes no mention of npm. This is strange because npm also supports the concept of workspaces and is Lerna’s default package manager.
So naturally, I am wondering if --use-workspaces
is safe to use with npm workspaces or not. Really, I would just like the ability to tell Lerna to use the workspaces that I already have defined in package.json so that I don’t have to define them again.
https://github.com/lerna/lerna/blob/main/commands/bootstrap/README.md#--use-workspaces
Issue Analytics
- State:
- Created 2 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
Workspaces - npm Docs
Workspaces is a generic term that refers to the set of features in the npm cli that provides support to managing multiple packages...
Read more >Getting Started with npm Workspaces - Ruan Martinelli
In fact, npm is not trying to reinvent the wheel. You can find similarities between all three Workspace implementations.
Read more >Is Lerna needed anymore with NPM 7.0.0's workspaces?
NPM 7 is out and it supports workspaces. they will also continue to develop this domain in the upcoming releases,.
Read more >Better dev environments with npm workspaces | oliverjam.es
As of version 7 npm now includes a feature called "workspaces". ... To use workspaces you need to be on the latest version...
Read more >npm workspaces and overrides #DemoDays - YouTube
Darcy Clarke, Staff Software engineering manager walks us through two significant additions to the npm -cli, workspaces and overrides along ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey, bumping again. Now that maintenance has been handed over to Nrwl, are there any plans to add proper support for npm workspaces? I think not much would actually need to be done, most of the necessary changes can probably be backported from Lerna Lite, which is only based on workspaces and dropped the whole custom bootstrapping process. I think the most important change would be properly handling the subpackage versions in the root package-lock.json file, when bumping versions (see https://github.com/ghiscoding/lerna-lite/blob/main/packages/version/src/version-command.ts#L657).
Given the following root-level package.json…
I can confirm that using “packages”…
is NOT equivalent to “useWorkspaces”…
At least not when using npm. I have not tested this with yarn.
But when you’re using npm, the two methods above will produce very different results when analyzing the structure of node_modules, both at the root level and at the workspace level.
It would be nice if the docs were more clear surrounding the intended usage of “useWorkspaces”, how exactly it operates, and whether or not it’s supposed to be compatible with npm workspaces.