goldbergyoni / nodebestpractices

:white_check_mark: The Node.js best practices list (July 2024)
https://twitter.com/nodepractices/
Creative Commons Attribution Share Alike 4.0 International
99.21k stars 10.08k forks source link

Should include Corepack in our recommendation? #1242

Open goldbergyoni opened 1 year ago

goldbergyoni commented 1 year ago

You mentioned Corepack as a tool that should get a mention along nvm/volta, should we indeed given that its 'beta' and has some npm support issues?

https://nodejs.org/api/corepack.html

@elektronik2k5

elektronik2k5 commented 1 year ago

I've been using it for over a year now without issues. What are the issues you're referring to?

goldbergyoni commented 1 year ago

My concerns/questions are:

  1. It's defined as experimental
  2. The supported package managers in the docs are: pnpm, yarm. Not npm (to my understanding based on a brief reading)
elektronik2k5 commented 1 year ago

That's cause npm is already bundled with node itself. But if I understand correctly, one can use corepack to manage and enforce the exact version of npm. Haven't tried it myself though, cause npm is rubbish.

goldbergyoni commented 1 year ago

The main idea IMO is the proxying to a pinned version, if the most popular package manager can't be proxied (regardless of its internal quality) - isn't it becoming a niche recommendation?

Seems to me like yarn/pnpm is widely used by savvy and brave developers, but not a mainstream tool. Am I wrong here?

josh-hemphill commented 1 year ago

All the vue-related projects on Github I've come across have been using pnpm, as well as a lot of other library authors. But if we're talking about node version management, pnpm has it's own node version manager built in.