I can’t find the answer to this seemingly obvious question anywhere.
I have some npm workspaces setup in a project. It’s basically a main project with several workspaces within it. They are in a top level folder called “packages”, each in its own folder with its own package.json.
I need to add the workspaces as dependencies of the main project. I’ve added them to package.json of the main project but npm keeps trying to install them from npm.org, and so it fails.
I’m using this syntax:
“workspaces”:[
“packages/*”
],
“dependencies”: {
“workspace-a”: “^0.0.1”
…
}
How do I specify the workspaces as dependencies in package.json?
[Update: the eventual way the main project is used is that it is a dependency of a totally separate project]
npm
doesn't support glob patterns, tryyarn
instead – Discount