DEV Community

Cover image for Stop using npm or yarn to install node_modules

Stop using npm or yarn to install node_modules

Kristiyan Velkov on July 18, 2023

PNPM saves disk space, boosts installation speed, and creates a non-flat node_modules directory. What is pnpm ? Pnpm is a package manag...
Collapse
 
nafg profile image
nafg

This wasn't written by chatgpt was it?

How exactly does it stand for "Fast, disk space efficient package manager"?

Collapse
 
jamesthomson profile image
James Thomson

The real answer:

pnpm stands for performant npm. @rstacruz came up with the name.

Src: pnpm.io/faq#what-does-pnpm-stand-for

Collapse
 
nafg profile image
nafg • Edited

My point is, the whole article reads sort of like ChatGPT, and saying that a word stands for something that doesn't abbreviate to it at all is just the sort of thing ChatGPT does.

The only exception is the table and graph, but it could have been generated separately, and the prompts are omitted.

Thread Thread
 
kristiyan_velkov profile image
Kristiyan Velkov • Edited

Hello, thank you for comment @nafg.

Yes, I use ChatGPT for some of my paragraphs, but hey mate, why do not use it ?

I didn't understand what is most important for you the information or how the article was written ?

Thread Thread
 
nafg profile image
nafg
  1. Then you should give it attribution and not give the impression that you wrote this yourself, of your own knowledge
  2. Perhaps more importantly, chatgpt is completely unreliable. If you are just pasting text that it generated, it could be full of information that's wrong, misleading, or misleading by omission.
  3. We can all access chatgpt ourselves. There's no need to spam a site that's ostensibly human-authored content, where we expect to learn from other people who have what to teach us, with content that we can get ourselves from chatgpt.
Thread Thread
 
kristiyan_velkov profile image
Kristiyan Velkov • Edited

So, I understand and agree with you of some of the points. Thank you!

But is it better like you to spam only and not to contribute at all, but you can judge people by what they use.

Please, write at least one article and you will see that is not so easy , so probably will stop to spam others.
Based on your profile and name mate you look like someone who want only to spam and distract people from what is most important - to learn something new.

Of course you can find almost everything in the web if you want.
People like you also.

Please, don't spam any more. Wish you all of the best.

Thread Thread
 
nafg profile image
nafg

Based on my name and profile how?

I'm pretty active on GitHub, so I guess you didn't check that

Collapse
 
supportic profile image
Supportic • Edited

No docker viable = unusable

It's not possible to share your pnpm global store across containers with a volume to leverage the symlinks. The virtual-store-dir variable in node_module/.modules.yaml has an relative path. This requires to have the same path structure and even then, the symlinks won't work and it loads the source files inside the node_modules directory. Running pnpm in 2 different containers will require to install dependencies again…
pnpm.io/docker

Collapse
 
kristiyan_velkov profile image
Kristiyan Velkov

I understand your concern with using pnpm in Docker containers, and it's true that sharing the global store directly using volumes might not work as expected due to the relative paths in the virtual-store-dir variable.

While using pnpm in Docker containers may not be viable with direct volume sharing, there are alternative approaches to handle dependencies efficiently. One option could be to use Docker multi-stage builds to cache the installed dependencies between build stages. This way, the dependencies don't have to be reinstalled each time you build the image.

Additionally, you could consider creating a custom base image with the frequently used dependencies pre-installed. This way, you can minimize the need to re-install them across multiple containers.

Every tool has its strengths and limitations, and it's essential to find the right balance that fits your specific use case. If using pnpm is not suitable for your Docker setup, you can explore other package managers like npm or yarn that might better align with your requirements.

Ultimately, the decision comes down to the specific needs of your project and the trade-offs you are willing to make. It's crucial to choose a setup that maximizes efficiency while ensuring seamless integration with Docker containers. Happy coding! 🚀💻 #Docker #pnpm #npm #yarn #containerization #development #efficiency

Collapse
 
turanmahmudov profile image
Turan Mahmudov

Man, you are literally using chatgpt to reply to a comment. Stop it already.

Thread Thread
 
kristiyan_velkov profile image
Kristiyan Velkov

Thank you for your comment.
Sorry,to say that hope you will understand me right 👍

Who are you to tell me what I need to use ???

If you like what the article brings to the public fine, if note sorry but don't spam.

Best regards,
Kris

Collapse
 
nicolasdanelon profile image
Nicolás Danelón

there is a package named please-use-pnpm that you could install ^^ the readme is pretty self-explanatory :)
great article ;) will mark the content as high quality on the mod panel

pnpm Is life
pnpm is love

Collapse
 
kristiyan_velkov profile image
Kristiyan Velkov

Thank you for the suggestion! 🙏 I checked out the "please-use-pnpm" package, and it looks promising! 😄 I'll definitely give it a try and explore its features further. Your article was a great read and provided valuable insights! 📚 I'm glad to hear you found the content to be of high quality, and your positive feedback motivates me to keep sharing helpful tips and tools with the community. 🌟

And yes, pnpm truly is life and love! ❤️ I couldn't agree more! It's a fantastic package manager that simplifies the workflow and saves so much space. Happy coding with pnpm! 🚀💻 #pnpm #pleaseusepnpm #package_manager #developerlife #happy_coding

Collapse
 
sushruth profile image
Sushruth Shastry

Yarn 2+ goes beyond this a bit on performance and space optimization. It has its fair share of compatibility issues but it is way better when it works. And it does mostly work.

Collapse
 
kristiyan_velkov profile image
Kristiyan Velkov

Absolutely! Yarn 2+ brings significant performance and space optimization improvements over previous versions, making it a powerful choice for managing dependencies in modern projects. The Plug'n'Play feature in Yarn 2 eliminates the need for a node_modules folder, which results in reduced disk space usage and faster installation times.

While Yarn 2+ has made remarkable progress in terms of performance and optimization, like any tool, it may have some compatibility issues with certain projects or packages. However, the Yarn team has been actively working on improving compatibility and addressing these issues to ensure a smoother experience for users.

When Yarn 2+ works well with your project, it indeed provides an efficient and streamlined dependency management solution, improving overall development productivity. It's great to hear that you've had mostly positive experiences with it.

As with any technology choice, it's essential to consider the specific needs and requirements of your project to determine the best package manager that aligns with your workflow and goals. Whether it's Yarn, pnpm, npm, or any other tool, staying informed about their strengths and limitations empowers developers to make well-informed decisions for their projects.

Keep exploring and experimenting with the tools that work best for you, and happy coding! 🚀💻 #Yarn #dependency_management #performance #optimization #development #happy_coding

Collapse
 
tillt profile image
Till

When ur comparision doesn't even mention audit capabilities ur either a kid which started programming 3 days ago or ur plain bad.

Collapse
 
nafg profile image
nafg

Or you think you chatgpt can ghost write for you