Replies: 1 comment
-
|
npm doesn’t currently provide a built-in way to check if node_modules is platform-independent. While a flag like --check-platform-independence could help build systems avoid issues with platform-specific modules, npm’s current approach relies on developers managing platform dependencies through optionalDependencies, peerDependencies, and os/cpu fields in package.json. Adding such a check would increase CLI complexity and isn’t aligned with npm’s current design philosophy. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Build systems like gradle can cache the entire
npm installprocess and relatednode_modulesfolder and make up to date checks using the hash of the folder. Unfortunately this is packed into a zip-file which doesn't allow symlinks and it's necessary to be careful because of platform dependent modules.I think it would help various build systems down the way if npm could provide a flag like
npm --check-platform-independancethat checks whethernode_moduleshas some platform dependent code, or can be reused freely.Beta Was this translation helpful? Give feedback.
All reactions