DEV Community

Discussion on: I'm the former tech lead for the NPM CLI, and I've been doing FOSS for 10+ years, Ask Me Anything!

Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard • Edited

I am usually doing backend programming on the JVM with gradle.org and when I do front-end development, the npm CLI seems to need a lot more of baby sitting. For example:

  • If I don't have the right version of Gradle installed, $ ./gradlew :myTask will auto-bootstrap it for me by downloading the right version of gradle-xx.jar. Node and npm on the other hand will just fail on me with a weird error message
  • If somebody added dependencies since last time, $ ./gradlew :test will detect it and install them. $ npm test will fail on me because I didn't run $ npm install first.
  • If I run two times the same task $ ./gradlew :myTask will complete almost immediatly with a message Task UP-To-DATE, while npm will gladly waste my time by actually doing everything twice.

Ever considered implementing at least some of those features?

Collapse
 
zkat profile image
Kat Marchán

I don't really work on NPM anymore, but I do work on a client for Entropic.

I think the first and third features are out of scope for how I generally think of package managers, but I might need to think more on that.

The second one, though, is something that ds (the Entropic client) will actually take care of for you. We'll see how it goes! Thanks for sharing!

Collapse
 
jmfayard profile image
Jean-Michel 🕵🏻‍♂️ Fayard • Edited

For the first feature, I think the package manager should at least document which version of node is required and fail with an explicit error message if it's not present.

The third feature was already present in Makefiles - although obviously in a crude implementation compared to what Gradle is doing.
docs.gradle.org/current/userguide/...

Update: maybe my questions are more about Webpack than about npm/entropic