debug icon indicating copy to clipboard operation
debug copied to clipboard

Please fix the spell mistake in 2.4.0

Open hefangshi opened this issue 9 years ago • 69 comments

https://github.com/visionmedia/debug/blob/master/debug.js#L126

https://travis-ci.org/fex-team/node-ral/jobs/183832044

hefangshi avatar Dec 14 '16 06:12 hefangshi

That too, industry is a mess!

tj avatar Dec 14 '16 19:12 tj

Agreed. Lecturing people on github issues isn't any way to enact real change.

I don't want to be lectured, but I'm waiting to hear back from the maintainers on my offer of help. Please stop, or I'll need to mute notifications and it'll be harder for them to get in touch with me.

yamikuronue avatar Dec 14 '16 19:12 yamikuronue

@yamikuronue if you wanna submit a PR to add coveralls integration and coverage reporting with our existing mocha tooling, it would be much appreciated :)

thebigredgeek avatar Dec 14 '16 19:12 thebigredgeek

@codeaholics @chancancode @chrisatomix

I figured out how I was getting the latest version and @dashmug is correct that it is caused by semantic versioning/semver. Using npm ls debug shows the required versions, but when you grep the package.json file you see that many of them are included as "debug": "^2.3.3". The caret will result in it using the latest available version that is less than "3.0.0", so when "2.4.0" was released npm used it as an acceptable version.

Using "debug": "2.3.3" would lock it to that version, but a lot of widely used modules use a caret range, like superagent, which is a dependency of supertest, which is being used to run tests on my Jenkins server. This is also how npm adds dependencies when you run things like npm i -S module as well as npm i -S [email protected] will both result in "module": "^1.0.0" being added to your package.json. This also points to a potential security flaw with using semantic versioning for npm installs, which hadn't occurred to me previously.

doublesharp avatar Dec 14 '16 22:12 doublesharp

@doublesharp In our case it was Yarn which was installing 2.4.0, due to this line: "debug": "^2.2.0", If we'd been using the precompiled version of Yarn instead of running npm install -g yarn our builds wouldn't have failed.

The irony is that it turned out our CI provider already includes Yarn in their default image! We didn't realise they'd added it last month, so we were able to remove the install command from our build script. It shaved about 10 seconds off our average build time :)

Like I said, this error might be a blessing in disguise. Especially now that everyone has realised how much of a critical component it is in so many other packages, the developer may get more support than he ever anticipated. It might even encourage the Facebook Yarn team to go through all their dependencies and make sure each one has automated testing in place.

chrisatomix avatar Dec 14 '16 22:12 chrisatomix

Looking for more input on V3 here: https://github.com/visionmedia/debug/issues/370

thebigredgeek avatar Dec 14 '16 23:12 thebigredgeek

@chrisatomix For sure, I never knew about npm shrinkwrap to lock all the dependencies to a particular version until it occurred to me how npm install was handling the semantic versioning. To be honest I never really thought that much about how it worked previously. I'm planning to generate an npm-shrinkwrap.json and manage the versions manually for anything critical - which is good knowledge to gain from a few failed builds :)

doublesharp avatar Dec 14 '16 23:12 doublesharp

@doublesharp the doco for npm ls says:

This command will print to stdout all the versions of packages that are installed, as well as their dependencies, in a tree-structure.

If you're saying it just prints the required version, and not actually the installed version, then that seems pretty broken to me!

codeaholics avatar Dec 15 '16 09:12 codeaholics

@codeaholics You're right, there must be something screwy with my project. I just created a test project, installed supertest, and it correctly shows the installed version of debug and not the caret range. Not sure why it was showing the old versions for me (especially considering I deleted node_modules and rebuilt them... I've since actually upgraded debug, so I'm giving up trying to figure out what was going on. :/

doublesharp avatar Dec 15 '16 19:12 doublesharp