You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both packages are detected as workspace packages and added to @pkg/targetpackage.json with workspace:* versions
Actual behavior:
The @pkg/public-patch package adds correctly, but the @pkg/public-pre package fails as it attempts to bypass workspace packages and go to the online registry
C:\Projects\github-bugs\pnpm-install-workspace>pnpm -F @pkg/target add @pkg/public-pre
ERR_PNPM_FETCH_404 GET https://registry.npmjs.org/@pkg%2Fpublic-pre: Not Found - 404
Additional information:
When testing, the only difference I can see is that @pkg/public-pre has a version number with a pre-release version in the package.json (2.3.4-next.4) wheas the other package has a simple Major.Minor.Patch version (2.3.4)
node -v prints: 16.5.0
Windows, macOS, or Linux?: Windows
The text was updated successfully, but these errors were encountered:
xenobytezero
changed the title
pnpm add fails to add workspace package with pre-release version numberpnpm add fails to add workspace package with pre-release version number
Sep 7, 2022
For me, it's hard to say if this is a bug or not, after all, installing from npm registry is also downloading the latest tag version.
I also found that it is possible to write the dependencies directly in package.json and install them:
// packages/internal/target/package.json
"dependencies": {
"@pkg/public-pre": "workspace:*"
}
$ pnpm i
Scope: all 4 workspace projects
dependencies:
+ @pkg/public-pre 2.3.4-next.4 <- ../../public/public-pre
Done in 1.3s
It seems that the add and install behavior is a bit inconsistent, so I feel that we can try to resolve the local package when adding if the remote package does not exist.
pnpm version: 7.11
Code to reproduce the issue:
https://github.com/xenobytezero/bug-pnpm-install-pre-workspace.git
Steps
pnpm -F @pkg/target add @pkg/public-patch
pnpm -F @pkg/target add @pkg/public-pre
Expected behavior:
Both packages are detected as workspace packages and added to
@pkg/target
package.json
withworkspace:*
versionsActual behavior:
The
@pkg/public-patch
package adds correctly, but the@pkg/public-pre
package fails as it attempts to bypass workspace packages and go to the online registryAdditional information:
When testing, the only difference I can see is that
@pkg/public-pre
has a version number with a pre-release version in the package.json (2.3.4-next.4
) wheas the other package has a simple Major.Minor.Patch version (2.3.4
)node -v
prints: 16.5.0The text was updated successfully, but these errors were encountered: