Turf: Package.json is missing a name

Created on 22 Jun 2017  ·  6Comments  ·  Source: Turfjs/turf

Hello, probably not very important but I tried to install turf from master using npm:
npm install --save https://github.com/Turfjs/turf

However it complained package.json was missing a name (tested on npm 4 & 5):
npm ERR! No name provided in package.json

Forked the repo and confirmed adding name fixes the error.

question wontfix

All 6 comments

I doubt you will have any success with package.json at the root repo since it's only used for dev purposes. The package.json that you will actually need is in packages/turf/package.json which installs @turf/turf.

👍 It would be beneficial to have the ability to install TurfJS directly from the GitHub directory, definitely open to suggestions.

First off I'd say installing the library from github is done precisely for dev purposes. It should never be the recommended installation but it should definitely work and if it doesn't it means there's some kind of issue with the way you integrated npm in the project.

As a suggestion, I wouldn't put the main package.json inside a directory. I don't know why this was done in this way but I'm very positive this decision will give you more headaches (like this issue) than benefits.

By looking at the README It seems that one the reasons behind this was to allow users to generate "minimal versions of the library", however there is no need for this anymore in modern js. Modern bundlers like Webpack or Rollup come with tree-shaking, which does exactly that.

A good example of a modular library that implements this behaviour is d3. Info:
Let's make a D3 plugin. It should be fairly easy to adopt for turf I believe.

I don't know why this was done in this way but I'm very positive this decision will give you more headaches (like this issue) than benefits.

Check out lerna: it's the reason for this structure, and why the turf/turf package isn't different than any of the packages. The same structure is true for the babel project, which also uses the same structure, and has many more users. I know this might seem a bit odd at first, but hopefully some of the discussion illuminates that, while it's a bummer to not be able to install from git, you win much more in exchange - the ability to cross-reference and coordinate releases between very complex packages.

To be clear, this decision is not related to 'minimal versions of the library' and is unrelated to tree-shaking. It's about the ability to develop and test multiple modules in the same repository, and while it may be unfamiliar to you, I hope that after reading a bit about lerna and considering the rationale, you understand why it's a worthwhile trade.

Closing this issue since the TurfJS folder/file structure won't be changing, thanks @tmcw for the explanation.

Thanks for the thorough and elaborated answer the question @tmcw. Never heard of lerna but you're right it looks useful and I'm sure you had very good reasons to integrate it in your project. I don't understand, however, why this is linked anyhow to the issue I opened.

Now please let's all quickly recapitulate before I disappear forever as this will be my last form of communication with you both.

I said in my first my message:

Forked the repo and confirmed adding name fixes the error.

I got a response from @DenisCarriere who comes and says it is impossible that I fixed the error. Ok. Dennis, did you care to reproduce this? No. Did you even take 1 minute of your time to test my suggestion? No,no. Still you are bold enough to dismiss an anonymous user who's actually taking 1 minute of his time to at least try to make your library better. ¯_(ツ)_/¯

Despite of this weird behaviour, I took the time and write a second answer trying to explain the issue better and clarify my points (anyone can have a bad day / I didn't express it correctly). The issue is put on hold for 3 weeks until yet another contributor finally comes along and try to school me in dependency management and code maintenance for no apparent reason but still HE DOESN'T CARE TO REPRODUCE THE BUG AND TRY THE SUGGESTED FIX, a DAMN one-liner. A simple addition that fixes your BROKEN package.json. No need to change the folder/file structure Denis please at least read the title of this issue FFS!!!

I solved my problem many days ago and didn't use your library so I really don't care if you fix it or not anymore, not even if you actually think this is an issue. Now, the level of pedantry, overconfidence and lack of respect for your users you demonstrated in this issue was out of the roof. In my 10+ years experience I had never been despised so much when contributing to an open source project.

Seriously guys, turf is useful and all, but it's not the Linux kernel. You can't treat people like this or you'll be killing your own library. Community includes you and me. When people open issues in github it's not that they want to laugh at your mistakes, it's that they want to make open source better. Think about it.

Best Regards,

Hi @ale0xb

All the maintainers of Turf work on this in our spare time, often late into the evenings. We do our best to respond to users who come to us with various suggestions for new modules, bugs, ways to structure the project etc etc. More often than not we have great interactions with our community and we're very thankful for them, it's part of the reason we stay up late!

In fairness I think both @DenisCarriere and @tmcw replied respectfully to you and tried to explain why it is the way it is, I dont think it is fair to accuse them of despising you because they chose not to adopt your suggestion.

Anyway thanks for stopping by and throwing in your two cents, sorry things didn't work out on this occassion.

Was this page helpful?
0 / 5 - 0 ratings