The WTF isn't NPM ...
-
So the guy next to me isn't the brightest bulb let us say, but he was sitting with a heavily pregnant front end developer. It was almost 5pm and she looked exhausted and they were still trying to get something to work. I kept on hearing "The instructions aren't correct". I look over and it is NPM. They were having this problem.
npm ERR! Error: No 'name' field found in package.json
Okay, so I googled the problem rather than what they were doing which appeared to be running npm install again repeatedly until it works. Plenty of google results, must be a common issue.
And found something similar ...
AHA, so I did some more googling and found this ...
The most important things in your package.json are the name and version fields. Those are actually required, and your package won't install without them. The name and version together form an identifier that is assumed to be completely unique.
I look into package.json file and both the name and version fields are missing. I add these into the package.json file, the installation starts as it should have done. NPM stops complaining and starts actually doing something.
I am not allowed to make any changes to this code. So I look up in TFS who created it, find out who the chap is and walk over.
I explain the issue which boils down to his package.json basically not adhering to the spec and I ask him politely if he can fix it. The conversation boiled down like this:
Him - "Oh it should work anyway, not sure why it isn't working."
I show him npm docs online.
Me - "No it isn't, you package.json is invalid and you may have a different version of the NPM tools installed which doesn't validate the package.json correctly. Our version does."
Him - "Well can't you just add them in for now?"
Me - "I have to solve the problem our end I have, but it isn't the solution. The NPM docs says that the file isn't valid"
Him - "Well it works on my machine"
Me (trying not to just tell him to fucking fix it) - "Can you just look into it please?"It is was a 2 line fix, FFS!
Then I go back to my desk and I am informed something else has gone wrong. Okay.
Basically matey hasn't installed the C++ compiler with Visual Studio. Okay.
Me - "Have you installed them"
Him - "Yes"At this point, I am assuming everyone is an idiot. So I check myself and they aren't. So I fire up VS installer and choose change installation and it is unchecked. Visual Studio installer than takes another fucking hour just to do anything.
I tell pregnant lady to go home as this will have to be sorted tomorrow.
-
@lucas1 said in The WTF isn't NPM ...:
running npm install again repeatedly until it works
Definition of insanity blah blah blah.
-
@FrostCat except in JavaScript, running the same code repeatedly doesn't always give you repeatable results ;)
-
@Arantor SQL Server as well. Each time I run "select GETDATE()" I get a different result. Weird...
-
@Vault_Dweller well, duh, but that wasn't what I meant ;) think it's in the status thread where code that actually should be repeatable 10000 times is only repeatable about 8000 times...
-
@Arantor that was posted by @cartman82 on the status thread, iirc. it is a great wtf that deserved it's own topic
-
@fbmac said in The WTF isn't NPM ...:
@Arantor that was posted by @cartman82 on the status thread, iirc. it is a great wtf that deserved it's own topic
We should it, because all users are morons who don't know how to
use the softwarecommunicate.
Filed under: The "civilized discourse construction kit" was doomed from the mission statement.
-
@Arantor why I can't find that post anywhere? do you remember where was it?
-
-
Before I left today the idiots were still at it. They were still trying to NPM install and ignoring the error messages. This time I couldn't be bothered to help.
I literally told them what needed doing yesterday.
-
I dunno what the more was WTF today.
- Frontend dev, repeating same crap as yesterday
- Frontend dev not using source control
- Not reading error messages to solve the problem
- Why I haven't run out the door
-
@lucas1 said in The WTF isn't NPM ...:
I dunno what the more was WTF today.
- Frontend dev, repeating same crap as yesterday
- Frontend dev not using source control
- Not reading error messages to solve the problem
- Why I haven't run out the door
I can't decide what to pick so I'll go with PHP.
-
@lucas1 said in The WTF isn't NPM ...:
heavily pregnant front end developer
maybe I just have but I was waiting for that to pay off, sitcom style.
Sidenote: There is no emoji. Emojis are brainless. That is appropriate.
-
@kt_ said in The WTF isn't NPM ...:
@lucas1 said in The WTF isn't NPM ...:
I dunno what the more was WTF today.
- Frontend dev, repeating same crap as yesterday
- Frontend dev not using source control
- Not reading error messages to solve the problem
- Why I haven't run out the door
I can't decide what to pick so I'll go with PHP.
Now you have
Notice: Undefined variable: problems in /var/www/problems.php on line 3
problems.
-
@Lorne-Kates said in The WTF isn't NPM ...:
There is no emoji.
or will have to do for that then; they're the only ones with
bra
in.They'll also do for other things…
-
@error said in The WTF isn't NPM ...:
Now you have
Notice: Undefined variable: problems in /var/www/problems.php on line 3
problems.I know, I'll use
mysql_real_count_problems()
!.
-
@FrostCat No, what you really want these days is
mysql_really_like_more_really_mysql_not_just_really_mysql_really_truly_count_real_problems_like_for_real_and_dont_break_this_one()
. That's what all the securer code has.This is because
mysql_real_count_problems()
goes into an infinite loop trying to factor the fact that you're using that function into your number of problems.mysql_really_like_more_really_mysql_not_just_really_mysql_really_truly_count_real_problems_like_for_real_and_dont_break_this_one()
bypasses this by trigging an integer overflow.
-
@FrostCat only until PHP 7 when
mysql_*
is gone. Not deprecated but gone.The decade+ old joke can finally go away!
*dances happy dance*
-
@Arantor said in The WTF isn't NPM ...:
The decade+ old joke can finally go away
not until mysql_real_go_away
-
@Jaloopa PHP Fatal error: call to undefined function mysql_real_go_away at line 1
-
@Arantor 1. fork php
2. remove stupid functions
3. everything is better
-
@fbmac said in The WTF isn't NPM ...:
@Arantor 1. fuck php
2. remove stupid functions
3. everything is betterFTFY
Though in reality, PHP really is cleaning up its act. It's quite beautiful to watch. Shame it's taken a decade longer than it should have.
-
@Arantor said in The WTF isn't NPM ...:
@Jaloopa PHP Fatal error: call to undefined function mysql_real_go_away at line 1
Stack Overflow answer:
Install phpLegacyAdapter plugin that adds these functions back in so ur code doesn't not break
-
@Lorne-Kates it's funny actually, it was discussed at work how we could move forward by removing the mysql adapter as it is today and then shimming the mysql_ functions with MySQLi instead... and no-one would ever have noticed the difference.
-
@Arantor If you're going to shim stuff, why not go directly to PDO? Is that not still the correct way of doing database work in PHP?
Also, is MySQLi like "urllib2" in Python? "Oops, we fucked up, let's do a new one and add a character to the end maybe people won't notice we fucked up".
-
MySQLi is not quite like urllib2. Way way back, PHP was GPL licensed. So it could use the MySQL library just fine. Then it went under its own licence and had to write a new connector library to handle it. So they figured, what the hell, let's go nuts and build a better interface to MySQL while we're at it. This is MySQLi - MySQL improved. It has a shit-ton of features the bare MySQL libraries don't, like prepared statements.
As for MySQLi vs PDO, MySQLi can be made almost in to a perfect drop-in replacement with minimal effort. PDO requires quite a bit more effort.
Though for shits and giggles, our current codebase has all three in various places, plus a shitty-ass query builder. If you haven't see That Thread in the lounge yet, you really should. It's quality stuff.
-
@Arantor The real problem is that you never moved to PDO in the first place when it came out, what, 10 years ago?
PDO, that great open source "innovation" which just happens to be a complete ripoff of Microsoft's ADO. How "innovative" open source is! But hey, at least it works.
-
@blakeyrat MySQLi came out with PHP 5.0, PDO didn't arrive as standard until PHP 5.1 (though was available as a compile-your-own extension for 5.0)
My lot... we're not even that old, when my lot started writing a code base, 5.2 was already EOL and 5.3 was the 'standard version', none of which helps to explain why my lot still write as if PHP 4 is a thing.
As for the wider community, PHP 4 EOL'd in 2007 and yet hosts were still actively using it well into 2012-3. PHP 5.0 came out in 2004 and it wasn't until maybe 2010 that 5.x could be seriously considered 'the standard' because shitty hosts hold everyone back.
Even now, in 2016, even when 5.3 has been EOL for nearly 2 years, hosts are still actively using it, to the point where when SMF decided it was going to make 5.3.8 a baseline owing to the encryption library they wanted for Bcrypt support for passwords, there were still complaints and 'could it be compatible for people on 5.2'.
Shitty fucking hosting holding everyone back, even in 2016.
-
@blakeyrat said in The WTF isn't NPM ...:
PDO, that great open source "innovation" which just happens to be a complete ripoff of Microsoft's ADO. How "innovative" open source is! But hey, at least it works.
Is it? Because PDO certainly has a lot of similarities to Perl's DBI (released in 1994) and PHP is known to have stolen a bunch of crap from Perl before...
-
@powerlord And all languages just copied the
IF
andFUNCTION
statements from FORTRAN! There's no innovation anymore!Seriously though, sometimes there's only one good way to do something.
-
@anonymous234 said in The WTF isn't NPM ...:
And all languages just copied the IFand FUNCTION statements from FORTRAN! There's no innovation anymore!
Totally.
-
@Arantor said in The WTF isn't NPM ...:
because shitty hosts hold everyone back
I wanted to use travis-ci for automated testing of my database stuff for a personal project, but they don't support Postgres 9.5 or 9.6, even though you can run the latest unstable code from various programming language compilers with like 1 line of yaml.
Not to say travis-ci is shitty, but when my program requires 9.4 at a minimum, I'd like to at least be able to test the non-minimum specs.
-
@ben_lubar said in The WTF isn't NPM ...:
I wanted to use travis-ci
But then you have github on you…
-
@lucas1 said in The WTF isn't NPM ...:
Basically matey hasn't installed the C++ compiler with Visual Studio. Okay.
I ran into this issue once. I could install some package (I guess js-dom), which we would basically use to "mimick DOM calls", and my colleague couldn't. Turns out the bloody thing, which included a great many packages and was an incredible bloat, needed, absofuckinglutely needed VC++ in order to do something trivial under Windows. That was the moment I gave up on npm and wrote a 200 line library, mostly declarations, that did just what we needed.
leftpad, leftpad, leftpad.
-
@Hanzo It doesn't help that the official C++ compiler tool chain is massive and took literally hours to install through the corporate firewall.