Comments (3)
This won't work. Node.js resolves symlinks to their real locations, so peer dependencies will resolved from the same place. It doesn't matter what packages will be in the node_modules near the symlinks, node.js will ignore that node_modules during resolution.
from pnpm.
That makes sense, glad I didn't start working on that before your reply! So the hard linking is required for peer dependnecies to be resolved properly.
I think the description on the pnpm website is a tad misleading:
you can modify the source code of the linked package, and the changes will be reflected in your project
Might be helpful to mention that transpiled code / newly added files will not be updated until re-running pnpm install
For others reading this in the future, an alternative solution I considered was some kind of watcher in the consuming service that listens for file changes directly in the linked package directory, and re-applies the hard link each time a change is detected.
It sounds like running install
each time we make a change is our best bet, so happy to close this.
from pnpm.
A bit more paper trail, I've been trying bun
with workspaces, and it's worked pretty well so far. I can compile my code in a workspace-linked package and the changes are immediately visible in consuming packages.
I wasn't able to get the same behaviour in pnpm
because the .pnpm
store seemed to be installing a singleton package in two different locations (the hash at the end was different), even though all of the packages in the peerDependency descriptor inside node_modules
were exactly the same.
from pnpm.
Related Issues (20)
- Getting `ERR_PNPM_HARDLINK_FAILED Error: EEXIST: file already exists, link` when pnpm install
- `pnpm list --recursive` should be sorted topologically
- `--ignore-engines` api in pnpm? HOT 2
- `pnpm upgrade --interactive --latest` breaks when using `.tgz` files as dependencies HOT 1
- The script written by node executes exec('pnpm update --latest \"@babel/*\"'), which does not take effect and does not report an error
- URL.canParse Error in Corepack Brew Formula with pnpm and use-node-version
- `pnpm licenses --json` in workspace package returns incorrect path
- How do I suppress this annoying "The modules directory ... will be removed and reinstalled from scratch..." question? HOT 5
- command `pnpm why` returns nothing HOT 2
- The requested module '/_nuxt/node_modules/.pnpm/@[email protected]/node_modules/@firebase/component/dist/index.cjs.js' does not provide an export named 'Component' (at index.esm2017.js:2:10) HOT 1
- `pnpm deploy` in a workspace creates `${deployDir}/node_modules/.modules.yaml` at the root of the workspace instead of under the requested deployment directory
- Please revert b970d96 HOT 3
- pnpm issues with corepack packageManager field
- Stuck after resolving packages
- With ignore-workspace-root-check set to true I am getting ERR_PNPM_ADDING_TO_ROOT HOT 2
- pnpm install --frozen-lockfile=false will not update the outdated packages HOT 6
- Cannot delete folder because esbuild.exe is locked HOT 1
- Cannot authenticate to private registry HOT 5
- `shamefully-hoist` Configuration Bug in pnpm HOT 4
- ffprobe Binary Lacks Execute Permissions When Installed in a Second Directory with pnpm
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.