Comments (3)
CraigMacomber/FluidFramework#4
from pnpm.
I can confirm that (setting link-workspace-packages=true
) fixed our issue. Thank you for the fix or maybe its a workaround? Either way, I'm happy to have it!
Given all references to the requested version explicitly use "workspace:~", and it worked fine in pnpm 7 and 8, I think this might still be a regression, so maybe this bug should stay open.
Reading https://pnpm.io/workspaces#workspace-protocol-workspace : (Emphasis added)
By default, pnpm will link packages from the workspace if the available packages match the declared ranges. For instance, [email protected] is linked into bar if bar has "foo": "^1.0.0" in its dependencies and [email protected] is in the workspace. However, if bar has "foo": "2.0.0" in dependencies and [email protected] is not in the workspace, [email protected] will be installed from the registry. This behavior introduces some uncertainty.
Luckily, pnpm supports the workspace: protocol. When this protocol is used, pnpm will refuse to resolve to anything other than a local workspace package. So, if you set "foo": "workspace:2.0.0", this time installation will fail because "[email protected]" isn't present in the workspace.
This protocol is especially useful when the link-workspace-packages option is set to false. In that case, pnpm will only link packages from the workspace if the workspace: protocol is used.
Based on my interpretation of that:
- link-workspace-packages=true should only be needed if we don't use "workspace" versions, and we do use them.
- Even if we didn't use "workspace" versions, since the requested version is in the workspace, it should resolve to the version in the workspace, not search npm, even without link-workspace-packages=true.
The observed behavior is its searching npm, and failing to find the package despite it being in the workspace, and using a workspace version, both of which should have prevented it from searching npm. link-workspace-packages=true
changes this, causing it to search the workspace for the workspace version, which it finds.
If this is intended behavior, I think those docs need updating for pnpm 9.
from pnpm.
@CraigMacomber I was able to find this fix quickly because I've read pnpm 9 breaking changes and knew that link-workspace-packages
had been changed to false
by default (it was true
by default in pnpm 8).
Anyway, thanks for pointing out outdated documentation. I will correct it.
from pnpm.
Related Issues (20)
- Dependency grouping in package.json HOT 2
- Allow comments in package.json HOT 1
- Pnpm install hangs indefinitely HOT 1
- 404 on pnpm install HOT 1
- Getting warning when node_modules in workspace HOT 2
- Replace workspace links for github packages
- optional dependencies reported as regular dependencies in .pnpmfile `readPackage` hook HOT 1
- cd fails in package.json script when shell-emulator=true
- Remove the default option `*eslint*` and `*prettier*` from `public-hoist-pattern` option in next major version
- [Documentation] GitLab CI docs should not use legacy `corepack prepare` HOT 2
- [ERR_PNPM_READ_FROM_STORE] Unexpected token '', ""... is not valid JSON HOT 3
- `strict-peer-dependencies` in combination with `pnpm.peerDependencyRules.allowAny` suppresses error message but exit code is 1 HOT 1
- zsh: /opt/homebrew/bin/pnpm: bad interpreter: /opt/homebrew/opt/node/bin/node: no such file or directory HOT 22
- manage-package-manager-versions=true,MAC OS crash HOT 7
- `use-node-version` proceeds to download a node version, even if desired node version is already installed
- Add a flag to update to not update `"*"` dependencies
- Cannot upgrade dependency's dependency with pnpm patch HOT 1
- Progress bar for "pnpm env use"
- pnpm dlx creates file paths exceeding 260 characters, which breaks node HOT 2
- pnpm installs all OS targets for `@next/swc-*` in Turborepo when rerunning `pnpm install` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pnpm.