Category: Fixes

The struggles are real, but the solutions are too. Read about the annoying problems I’ve faced and the (sometimes creative) fixes I’ve found to overcome them. Because who hasn’t wasted hours on a stupid bug?

  • Fixing Nuxt Installation: “ERROR TTY initialization failed: uv_tty_init returned EINVAL (invalid argument)”

    Fixing Nuxt Installation: “ERROR TTY initialization failed: uv_tty_init returned EINVAL (invalid argument)”

    Should I? Or shouldn’t I? This is what I keep asking myself every time I pack my bags for a vacation, short or long. Do I really need my MacBook Air on Koh Samui? Maybe I’ll get into a situation where a simple iPhone is not enough. Watching a movie, for example. Or writing code.

    tl;dr

    Downgrade Node.js via nvm from 25.x.x to 24.x.x (LTS):

      # Download 24.11.1 (LTS) version
      nvm install --lts
      
      # Apply version
      nvm use --lts
      
      # Verify Node.js version; should show: v24.11.1
      node -v
      Bash

      Install the dependencies with yarn instead of bun:

        yarn
        Bash

        Coding under Coconut Trees

        I get it, totally. Sitting on a 28°C-degree tropical island, surrounded by pristine beaches and a forest of coconut trees so high that they almost kiss the sun, doesn’t seem to be the ideal location to open a code editor and look at what other hotel guests may interpret as hieroglyphs.

        It’s not only nerdy, but outright sad. “There,” says the toddler to his dad, “he’s playing computer,” pointing at me with his finger. And dad? He says nothing but slowly shakes his head and is—once again—reinforced in his belief that people, the “generation X,” aren’t capable of going anywhere without their digital opium.

        “Test Something”

        On one hand, he’s right. On the other hand, he’s not. Without drifting off the actual topic like a dinghy in the Gulf of Thailand, I can only say: I had a very good reason.

        However, that reason had nothing to do with the error I encountered today for the first time. Long story short, I needed to clone one of my Nuxt 4 projects and run the development server to—let’s keep it vague because it doesn’t matter—test something.

        The usual steps:

        1. git clone https://gitlab.com/.../project
        2. cd project
        3. bun i

        “ERROR TTY initialization failed”

        And that’s where it went awry. As a side note: Whenever possible, I use the package manager bun. It works for the vast majority of projects, and it’s blazingly fast, especially once packages have been cached.

        But this time, bun i stopped with an error that didn’t really tell me much:

        ERROR  TTY initialization failed: uv_tty_init returned EINVAL (invalid argument)
        Bash

        A quick Google search showed that I wasn’t the only one having this problem with the combination bun + Nuxt. The GitHub user corpix proposed a quick fix for this by setting export NUXT_TELEMETRY_DISABLED to 1. To me, however, this felt more like a hack than an actual solution, just like other fixes.

        Console showing ERROR TTY initialization failed: uv_tty_init returned EINVAL (invalid argument)
        The error message in all its glory.

        What’s uv_tty_init?

        So I kept digging. It turns out that uv_tt_init has something to do with Nuxt’s telemetry module (hence corpix’ fix). The module tries to prompt you (via TTY) to opt in/out of analytics during initialization. However, bun has a known bug handling TTY streams on certain platforms(especially Windows, but also in non-interactive terminals), causing this EINVAL error.​

        What made things a whole lot clearer was when I tried to install Nuxt via good, old yarn. Reliably, it reported the same error, but this time with some information that could be fixed easily:

        The engine "node" is incompatible with this module. Expected version ">=18.0.0 <=24.x". Got "25.2.1"
        error Found incompatible module.
        Bash

        On the Safe Side with LTS

        Seems like Node.js 25.x.x doesn’t get along with the telemetry module. Luckily, using the Node Version Manager, or nvm, downgrading to 24.x.x was a matter of seconds. It downloads the LTS version 24.11.1, and developers usually make sure that their code works with the latest LTS.

        If you’re not sure whether you have nvm, simply run nvm -v. If it’s installed, it should give you its version number. At the time of writing this, I received 0.40.3.

        If the command wasn’t found, it’s quickly installed by running brew install nvm (I’m assuming we’re all on macOS here and have Homebrew installed). Pay attention to the installation, because at the end, you’ll have to copy some lines and add them to your .zshrc. This is what you’ve got to add at the bottom of your .zshrc:

        # NVM (Node Version Manager)
        export NVM_DIR="$HOME/.nvm"
        # This loads nvm
        [ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh"  
        # This loads nvm bash_completion
        [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm"
        Bash

        Done? Great. Then restart your terminal or session, and you should then have access to the nvm command. And now, we

        1. download the latest LTS version via nvm install --lts
        2. and tell our project to use it by running nvm use --lts

        At this time, --lts means v24.11.1. The output in your terminal or console should be:

        Now using node v24.11.1 (npm v11.6.2)

        And that’s already it. You can leave Nuxt’s telemetry working instead of just suppressing the error, and reinstall your packages with bun i or yarn (or whatever package manager you prefer).

        Once all is installed properly, run bun dev or yarn dev and see your beautiful Nuxt page starting up. Grab yourself a fresh coconut while you’re waiting and go to the beach to wash off the nastiness of Node.js error messages.

        Enjoy your vacation!

      1. Fixing WebStorm’s Copilot Plugin Error Message: “Sign in failed. Reason: Could not log in with device flow”

        Fixing WebStorm’s Copilot Plugin Error Message: “Sign in failed. Reason: Could not log in with device flow”

        I’m an avid user of GitHub’s Copilot, and since I never code in anything but JetBrains products, I’m using the GitHub Copilot plugin for WebStorm and all of my other IDEs. However, yesterday I had a weird error. As so often, it turned out, the error was: me.

        (more…)
      2. Nuxt v3.16 is out—and TailwindCSS doesn’t seem to like it and breaks styling after upgrade. Here’s how you can fix it

        Nuxt v3.16 is out—and TailwindCSS doesn’t seem to like it and breaks styling after upgrade. Here’s how you can fix it

        With big fanfare, Daniel Roe, the inventor and person in charge of Nuxt, proudly released the newest version of my favourite JavaScript framework on March 7, 2025: Nuxt v3.16. It promised better performance, better error handling, and a lot more. The full announcement blog post showed that all Nuxt contributors are proud of the new version. They also gave instructions on how to upgrade to v3.16 from previous versions—which immediately broke my Tailwind styling. However, thanks to the Nuxt community, I can now show you the easy fix to this problem.

        (more…)
      3. Enable or disable dark mode in Nuxt 3 with NuxtUI v2 and Tailwind with this easy plugin

        Enable or disable dark mode in Nuxt 3 with NuxtUI v2 and Tailwind with this easy plugin

        I love dark mode. With a few exceptions, all of the websites I visit, program, or use as apps on my iPhone have dark mode enabled. When it comes to Nuxt 3, my favorite front-end meta-framework, it can only be just a setting in the nuxt.conf.ts file.

        Or not?

        (more…)
      4. PHP module “imagick” failed to install with “error: not found. Please provide a path to MagickWand-config or Wand-config program.” Solve it in 2 minutes

        PHP module “imagick” failed to install with “error: not found. Please provide a path to MagickWand-config or Wand-config program.” Solve it in 2 minutes

        At around 04:30 in the early morning of Monday, January 12t, 2024, I had a spontaneous epiphany. It was clearer than ever that my iMac—already an old model bought in 2022 with only an M1 chip—needed to be wiped clean and its OS reinstalled. A total reset, barely two hours before sunrise.

        (more…)
      5. Reddit Double-Refreshing in Chrome and macOS? It’s AdGuard. Here’s the Fix

        Reddit Double-Refreshing in Chrome and macOS? It’s AdGuard. Here’s the Fix

        Okay, I admit, this one is probably a case that only applies to myself, but you never know. For a few weeks now, Reddit has been annoying me by reloading every page I am on—sometimes even twice. By tediously eliminating all extensions and plugins one by one, I eventually found the culprit—a simple checkbox in AdGuard’s settings security settings.

        (more…)
      6. Nuxt v3 Error: “ERROR [unhandledRejection] Nuxt instance is unavailable!”

        Nuxt v3 Error: “ERROR [unhandledRejection] Nuxt instance is unavailable!”

        Another day, another Nuxt project. Nuxt has just released v3.14.1592, which I chose because I wanted to have a look at the unannounced Nuxt v4, which uses TailwindCSS v4 and other packages with major changes.

        So I ran the usual single-line command line to install Nuxt from scratch and I’m ready to explore—or so I had thought.

        (more…)
      7. Quick fix for “ExperimentalWarning: CommonJS module using require()” error message in Node.js

        Quick fix for “ExperimentalWarning: CommonJS module using require()” error message in Node.js

        JavaScript frameworks and meta-frameworks such as Next.js or Nuxt.js are everywhere. Working with them locally is astonishingly easy; all you need is Node.js and a package manager.

        If you’re using the latest version of Node.js, chances are good that you’ve run into the same bug as I have, and it appeared whenever I launched the development server: “ExperimentalWarning: CommonJS module using require().” Here’s the reason why it pops up and two ways to fix it.

        (more…)
      8. Here’s how to fix “Fatal error: Cannot declare class” in PHP Composer

        Here’s how to fix “Fatal error: Cannot declare class” in PHP Composer

        I ran into a small problem while trying to install packages with PHP Composer. The error message didn’t help me. Here’s how you can fix it in under one minute.

        (more…)
      9. Login error with GitHub’s Copilot plugin in JetBrains 2024.2 IDEs: Here’s how I fixed it

        Login error with GitHub’s Copilot plugin in JetBrains 2024.2 IDEs: Here’s how I fixed it

        I’m using WebStorm by JetBrains as my go-to IDE for most of my front-end projects. As I was about to start it to continue one of my projects, from one day to the next, I was confronted with multiple errors that, in the end, wouldn’t let me log in to the super helpful GitHub Copilot plugin.

        A thorough Google search didn’t yield any useful results on how to fix this, but it seemed like this is not a new bug. I’ve seen similar reports going back as far as February 2023.

        However, the good news is, after tinkering around a bit, I found a way to fix this issue and use Copilot on every JetBrains product again. The following steps explain how I solved it, step by step. I can’t guarantee that it’ll work on your system, but it’s worth giving it a try.

        (more…)