Comments (4)
I previously mentioned that in the virtual store, pnpm handles things correctly, but the flat node_modules directory (outside of
.pnpm
) created by the symlink doesn't resemble the structure seen in yarn or npm's node_modules
I don't think pnpm should goes out of its way to emulate the quirks of other package managers.
with the only distinction being that version 4.3.0 is more up-to-date?
Maybe this distinction is precisely why pnpm prioritize up-to-date version. Can you confirm this, @zkochan?
Regardless, there's no reason pnpm should prioritize the outdated version over the up-to-date one. I'm not sure how yarn and npm prioritize the versions, but (again) there's no reason for pnpm to emulate the others' quirks.
Is this a result of an error in using the shamefully-hoist option?
No. There's no rule that one should be prioritized over the other.
Additionally, as I create a React Native monorepo using pnpm and encounter issues with webpack's inability to interpret the pnpm structure, even with the shamefully-hoist option enabled, I've managed to resolve the situation with Metro and @rnx-kit/metro-resolver-symlinks, but I find myself at an impasse with webpack.
For this, I have 2 suggestions:
- Try adding
node-linker=hoisted
to your.npmrc
. - Don't use webpack for new projects. Try Vite.
Furthermore, any guidance on resolving the webpack issue within the context of a React Native monorepo using pnpm would be greatly appreciated.
I'm not familiar with React Native so I don't think I can give any advice.
from pnpm.
It works as expected. As @KSXGitHub said, the symink inside .pnpm
is correctly pointing to css-select
v2. If you need hoisting identical to the one used by Yarn, you need to use the node-linker=hoisted
setting.
from pnpm.
Upon inspecting the
node_modules
directory, a noticeable discrepancy is observed. Specifically, thereact-native-svg
package has a dependency oncss-select
with version ^2.1.0, yet it is erroneously linked tocss-select
version 4.3.0. This inconsistency stems from the fact thatnode-html-parser
has a dependency oncss-select
version 4.3.0.
Clarify what you mean by "inspecting". How did you inspect them?
When I clone your repro repo and do pnpm install --ignore-scripts
, I see that node_modules/react-native-svg
is a symlink to [email protected][email protected]_@[email protected]_@[email protected]_@babe_owypsel7dhtjfk3xu57dofh4dy
and css-select
inside the symlink target is the correct version.
Like yarn, it create
css-select
4.3.0 in node_modules ofnode-html-parser
, andcss-select
2.1.0 flat
Why should pnpm prioritize 2.1.0 over 4.3.0? Both are the same "rank". Why should pnpm prioritize dependencies of react-native-svg
over that of node-html-parser
? They are equal, the only difference is that 4.3.0 is more up-to-date.
Finally, I have a feeling that this issue of yours could be an XY problem. Let me know what you're trying to solve by shamefully-hoist
and I may or may not be able to help you.
from pnpm.
When I clone your repro repo and do
pnpm install --ignore-scripts
, I see thatnode_modules/react-native-svg
is a symlink to[email protected][email protected]_@[email protected]_@[email protected]_@babe_owypsel7dhtjfk3xu57dofh4dy
andcss-select
inside the symlink target is the correct version.
I previously mentioned that in the virtual store, pnpm handles things correctly, but the flat node_modules directory (outside of .pnpm
) created by the symlink doesn't resemble the structure seen in yarn or npm's node_modules
Why should pnpm prioritize 2.1.0 over 4.3.0? Both are the same "rank". Why should pnpm prioritize dependencies of
react-native-svg
over that ofnode-html-parser
? They are equal, the only difference is that 4.3.0 is more up-to-date.
Now, let's address the question of pnpm prioritizing version 2.1.0 over 4.3.0. Both versions are of the same "rank," so why does pnpm choose one over the other? Additionally, why does pnpm prioritize dependencies of react-native-svg over those of node-html-parser when both are equal, with the only distinction being that version 4.3.0 is more up-to-date?
The flat node_modules seems to lack the css-select 4.3.0 version, deviating from the structure typically found in yarn or npm-created node_modules. Is this a result of an error in using the shamefully-hoist option?
Additionally, as I create a React Native monorepo using pnpm and encounter issues with webpack's inability to interpret the pnpm structure, even with the shamefully-hoist option enabled, I've managed to resolve the situation with Metro and @rnx-kit/metro-resolver-symlinks, but I find myself at an impasse with webpack.
Is my understanding of the situation accurate, or have I misunderstood the implications of shamefully-hoist? Furthermore, any guidance on resolving the webpack issue within the context of a React Native monorepo using pnpm would be greatly appreciated.
from pnpm.
Related Issues (20)
- `winget upgrade pnpm` will remove the PATH FROM user env path, and won't added the new PATH to user env path again. HOT 1
- Add a self upgrade options
- `pnpm up` doesn't update `peerDependencies`
- `pnpm install` without input fails when already node_modules exists HOT 2
- print how to upgrade pnpm when `packageManager` version doesn't match HOT 1
- `package-manager-strict` enforcement in pnpm 9 is a massive headache HOT 15
- Error while running `pnpm run ...` HOT 2
- [Feat/Bug] `pnpm init` does not respect `init.*` options as flags like `npm init --init-*` HOT 3
- PNPM consider Turborepo packages as npm packages HOT 2
- v9 install command upgrades Lockfile in CI environment HOT 1
- "pnpm why" doesn't work properly
- pnpm can create forbidden file name on windows HOT 1
- package peerDependencies are written into the lock file as if they were dependencies. HOT 1
- I cannot update version HOT 1
- `pnpm outdated` is suggesting an *older* version as the latest version
- Can't use pnpm global packages via SSH
- EBUSY: resource busy or locked and EPERM: operation not permitted on windows
- jsonwebtoken package is not compatible
- Missing dev dependencies (or executables) in Dockerfile HOT 1
- add npm "home" command
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.