I have a Node.js project separated in several custom packages, each having their own package.json
file. This is all custom code for that specific project. Some have dependencies/devDependencies
, and when running
yarn install
all dependencies are installed and everything goes smoothly.
The content of the package.json files are as follows:
{
"name": "my-custom-package-name", // This changes in each package.json file
"version": "1.0.3-beta.1", // The version is the same in all package.json files
"private": true,
"repository": "https://github.com/my-organization/my-private-repo",
[...]
}
Now I am asked to do a new deployment of the project to production and to increment the version number of the packages for the new release. So I change the version number in each package.json
file by removing the prerelease tag to:
"version": "1.0.3.1"
But then, if I run yarn install
again, for each package where the prerelease tag was removed from the version number of the custom package, I get an error like this:
yarn install v1.3.2
[1/4] Resolving packages...
error Couldn't find package "my-custom-package-name" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Why is this happening when the prerelease tag is removed? Why is this not happening when the prerelease tag is there?
Those packages are not being used as dependencies for any other package of the project, so why is yarn trying to resolve a package on npm that matches the name and version of the package.json files?
I really looked around on the Web trying to find answers relating to this, but could not find anything relevant.