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
Is there a way to install all npm dependencies globally (centrally) so that you do not store node_modules in the project folder?
This is causing problems as the framework the company I work for uses is quite heavy and I have over 40 projects each with their own node_modules folder, packed with millions of 1kb files.
This takes up a surprising amount of precious space on my SSD and it would be really nice if I could just install these packages once, with any project's package.json linking to my local repository
The text was updated successfully, but these errors were encountered:
@alshdavid things that you require are dependencies, and need to be installed locally. global modules are for non-project-specific command line tools.
imo this isn't really a yarn question unless yarn provides a way to symlink global modules into the local directory, which I'm led to understand wouldn't work with the npm ecosystem.
I think this would be useful. The issue is that it's hard to change how things are done without changing Node.js, as Node.js expects things to be done a particular way and modules to be arranged in a particular way. 😞 I'd also love to rename the directory from node_modules to something else as not everyone uses Node.js.
There's a few GitHub issues around symlinks and hardlinks as a potential solution for performance and disk space - #499 covers hardlinks. The files would still take up some space in the file system though. I feel like a Copy-on-Write filesystem such as BTRFS or ZFS would help with this too, as the files won't actually be copied and would instead just point to the original files in the cache directory.
Is there a way to install all npm dependencies globally (centrally) so that you do not store node_modules in the project folder?
This is causing problems as the framework the company I work for uses is quite heavy and I have over 40 projects each with their own node_modules folder, packed with millions of 1kb files.
This takes up a surprising amount of precious space on my SSD and it would be really nice if I could just install these packages once, with any project's package.json linking to my local repository
The text was updated successfully, but these errors were encountered: