Open Badisi opened 2 years ago
EDIT: I think the best recommendation is to use "version": "0.0.0-semantically-released"
as you do.
It is self-explanatory and it avoids the issue below.
Consider the following:
B
depending on a package A@^1.0.0
(located and developed in the same mono-repo).A
has no package.json#version
, then running npm install
will either:
A@^1.0.0
does not exists (if it was never or not yet published)projects/B/node_modules/A
(in case A already exists on npm registry) which is not much recommendedroot
└── projects
├── A
├── B
└── C
// root package.json
{
"name": "my-workspace",
"workspaces": [
"projects/A",
"projects/B"
]
}
// A package.json
{
"name": "A"
}
// B package.json
{
"name": "B",
"dependencies": {
"A": "^1.0.0"
}
}
Using the following will makes npm
find the local version of A
which is what we want.
And thanks to MSR all those versions will be replaced during the release process.
// A package.json
{
"name": "A",
"version": "0.0.0-semantically-released"
}
// B package.json
{
"name": "B",
"version": "0.0.0-semantically-released"
"dependencies": {
"A": "0.0.0-semantically-released"
}
}
Lools like an old elusive bug in the deps updating algorithm. I've tried to replace concurrent events flow with toposort-based queue, but it may have gotten even worse.
I don't think this is related to your update as the error here comes from the normalize-package-data
package.
It simply does not accept "*"
as a version.
But anyhow it was just a "recommendation" in your documentation, so updating the doc to recommend "0.0.0-semantically-released"
instead seems not a big deal 🙂
According to the documentation:
But using
"*"
will bring the following error :Invalid version: "*"
.So I think it might be better to recommend not having the
version
property at all (which works in my case).Trace