'yarn 2+ (berry) `npm` protocol switches to `workspace` resolution

I have monorepo with libs and yunona folders which is included in workspaces of root package.json

 "workspaces": [    
    "libs/*"
    "yunona"
  ]

libs contain private and public libraries. public libraries are published to our company npm registry.

yunona is our web project built by webpack and references private libs via workspace protocol and public libs via npm protocol. yarn protocols,

"dependencies": {
   "@bims/erarta": "npm:^1.13.1",
}

yarn why @bims/erarta

Now, our public library erarta has gone ahead and has version 1.14.1 (and published to npm), and I also have updated package.json of web project yunona with this this version, and now what I get after yarn install

yarn why @bims/erarta

which is quite unexpected, it now uses workspace protocol via npm ?

I expected it to still consume this package via npm registry - so I specifically set in package.json of web yunona project

"dependencies": {
   "@bims/erarta": "npm:^1.14.1",
}

Can someone explain this behavior, and how can I pin npm protocol for good ?

I also started discussion here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source