Npm seems to be broken but I can't figure out why

Hmm, I’ll try that then. I’ll just snapshot its current state so I have a copy of files I’ve changed so I can easily keep the parts that work.

Thanks for the help.

You do know, that npm has to be run as root, right?

I’m always logged in as root since it is a container.

You know, funny thing about that. That ended up being my issue. However, it’s the opposite.

If I try to run npm as root or with sudo, it locks up as I’ve mentioned. If I run it as my normal user (who is part of the wheel group), it works fine.

I believe I ran npm as my user originally, but I can’t be sure why I ended up doing that, other than root causes it to fail.

I’ve tried it on various snapshots of my container, and all of them do it, but running npm as my regular user solves my problem in that NPM will actually respond when used, however my user lacks write access to the location I was installing npm modules, so … not sure how it’s ended up like this.

Odd.

1 Like

And I’ve removed the solution because the symptoms have changed.

Now if I do npm -v, it completes but doesn’t return anything. Completes means it doesn't force me to kill the process.

I’m now attempting a reinstall of npm’s modules with npm install, but if I do this with my normal user, it gives output (i.e. a progress bar, scripts running, etc). If I do it with root, it gives nothing and it usually takes a bit, so I can’t be sure it’s not doing stuff.

I wish there were an error log for npm, but all I’ve seen is a module for errors which doesn’t help if the errors are with npm itself.

Frustrating, because I don’t know what changed to let basic commands complete without output.

This sounds really ball-busting man, I feel for you. I’m so glad I’ve never had to deal with any complex node stuff in production.

When did frontend and js get so busted man? What was so wrong with jquery? Where did we go wrong? Do we deserve this? Were our sins so great?

out of curiosity what do you need to run in node?

1 Like

Well, I want AJAX auto-updating tables. Meaning, no page refreshes are necessary for tables to show new information.

See this thread:

The J in AJAX is JavaScript, and I’m also using Laravel PHP framework in building the website.

I’m glad you asked that question though, because the reason I was using NodeJS is because that’s what the tutorial I was following to learn Laravel’s basics used. Now that I look for alternatives, I find this page:

https://laracasts.com/discuss/channels/requests/nodejs-with-laravel

WebSockets is useful for “when to get new data”, but it doesn’t handle the partial page refresh aspect.

Basically his answer.

I may try redoing this from scratch in a separate Linux Container and see if it breaks that way.

May be worthwhile. Can’t get any more busted than your current container lol

1 Like

dude, if you want to use websockets then just use MeteorJS. Comes prebuilt with nodejs internally as well.

Also, if you need help with understanding Meteor I’ve got a pretty decent grasp of it.

2 Likes

Nothing is wrong with Jquery per se. Things still use jquery in modern frameworks, but have shifted very fast.

Nothings wrong, its just the evolution of the language.

Saying nothing’s wrong with the current state of JS is wholly inaccurate by any metric.

Not saying it’s useless; far from it – but that shit needs maturity and people that aren’t hobbyists writing all the extensions and frameworks.

So what, you mean like typescript being the future?

Mainly the fragmentation, ridiculous dependencies and configuration requirements, and rube-goldbergian nature of everything in frontend right now.

The joke is often “JS is an acronym for Job Security” because there’s no clean method for anything and best practices and standards either don’t exist or just plain aren’t followed by the majority of people depending on what you’re trying to build. It’s often easier to keep a shitty JS employee than try and find someone who can decipher their spaghetticode.

Nothing more nightmarish than trying to work out how the last guy got all his JS duct taped together and somehow functional. There’s a new esoteric framework with unique gotchas and incompatibilities made every day, and these trends are only accelerating.

Well, as long as a place uses React, React Native, Vue, Angular or Meteor; then it can’t be so bad. A lot less custom spaghetti code.

Most MVW framworks/libraries really just have Node as a dependency, or bake their own. Elaborate on this please?

agreed. Though, I’m not a professional dev so I haven’t experienced this first hand.

That’s the thing. There’s scads of others people use in production. Can’t rely on the asshole before you to be relatively sensible

as for ridiculous dependencies, there’s packages that pull images of guy fieri, make you like a hot pockets ad on twitter if you install it with your browser open, projects that require transpilation through babel 3 times to work, and other shit no sane software ecosystem engenders. I’ll admit most of the BS is mainly frontend but it’s spilling over into other things as time goes on.

First thing I’d do is analyze the situation, and layout a plan to replace all shit.

I don’t know why people like making shit code bases. I guess they think it gives the job security?

so many repeated man hours.

they KNOW it does. I know no less than 20 shitheads that can’t program competently coasting on their unintelligible JS entrenchment

any of those places hiring? xD

no, because they know the cost to replace their JS tumors is more than keeping the idiots onboard.

Some of these people work for fortune 500 companies.

1 Like

fuck