Do not Install Karma Globally

| programming | ci | javascript |

Wow, I spent so long trying to figure out why the hell karma was not working for me, it turns out its because it was installed globally. For instance. In my projects package.json I had:

"scripts": { "test": "karma start karma.conf.js" } ...
When I ran npm test - it told me sh 1: karma not found Every other possible combination also did the same thing. i.e.
node_modules/karma/bin/karma

./node_modules/karma/bin/karma

node ./node_modules/karma/bin/karma

I could totally execute this myself from the shell, so I had no idea what was wrong. Then I finally stumbled upon this GitHub Issue. After uninstalling karma globally, npm uninstall -g karma I was able to run npm test without any issues. I still have no idea why this works or didn't work. But at this point I just want to go back to writing tests.

Thank you for reading! Share your thoughts with me on bluesky, mastodon, or via email.

Check out some more stuff to read down below.

Most popular posts this month

Recent Favorite Blog Posts

This is a collection of the last 8 posts that I bookmarked.

Articles from blogs I follow around the net

Cheap mini PCs have gotten really good

For the past week, I've been working off the Minisforum UM870. A tiny mini PC with an 8-core/16-thread AMD 8745H CPU, which retails for $343 (or €379) as a bare-bone unit, and stays below $550, even after adding 48GB of RAM and 1TB of storage. I'…

via David Heinemeier Hansson May 18, 2025

Pluralistic: Plinkpump linkdump (17 May 2025)

Today's links Plinkpump linkdump: A blogging sabbath. Object permanence: 2005, 2010, 2015, 2020, 2024 Upcoming appearances: Where to find me. Recent appearances: Where I've been. Latest books: You keep readin' em, I'll keep writin' …

via Pluralistic: Daily links from Cory Doctorow May 17, 2025

Celebrating kindness

When I started working on the new version of blogroll.org, one thing I knew I wanted to do from the get-go was to highlight all the wonderful people who are supporting what I do here in the digital world. And the reason why I wanted to do …

via Manuel Moreale May 17, 2025

Generated by openring