Skip to content

Help needed updating this project to install correctly with nodejs 22 and later #20

Closed

Description

@ashenshugarRET

I've been working to update my installs of this excellent project and I have it installing on Raspberry Pi OS trixie (the latest version) and nodejs v20, but the install process fails for nodejs v22 and v24.

I'm a bit out of my depth here as this is the only project I use that uses nodejs, npm and pm2.

Any help in advancing compatibility to nodejs version >20 would be welcome.

When using nodejs and trixie, I had to do the following to get the NFC reader recognised by the system:

Create a file /etc/polkit-1/rules.d/60-pcscd.rules with this content:

polkit.addRule(function(action, subject) {
    if (action.id == "org.debian.pcsc-lite.access_pcsc" &&
        subject.isInGroup("plugdev")) {
        return polkit.Result.YES;
    }
});

then, create a file /etc/udev/rules.d/99-acr122.rules with this content:

SUBSYSTEM=="usb", ATTRS{idVendor}=="072f", ATTRS{idProduct}=="2200", GROUP="plugdev", MODE="0660"

to activate the udev rule, execute the following:

sudo udevadm control --reload-rules

Currently, the reader only works if the project is ran with sudo, so I have a permissions issue somewhere, but I'm struggling to fix that too...

Activity

  1. ashenshugarRET commented on Apr 28, 2026

    @ashenshugarRET
    ContributorAuthor

    I've managed to get the project installed with Raspberry Pi OS Trixie and Nodejs 22 by deleting the package-lock.json file and updating package.json to:

    {
      "name": "sonos-nfc",
      "version": "0.1.0",
      "description": "Use NFC tags to control Sonos - a node app inspired by and compatible with hankhank10/vinylemulator, with better NFC reader compatibility",
      "main": "sonos_nfc.js",
      "type": "module",
      "engines": {
        "node": ">=16.0.0",
        "npm": ">=7.0.0"
      },
      "scripts": {
        "test": "jest",
        "start-all": "concurrently --kill-others \"npm start\" \"npm explore sonos-http-api -- npm start\"",
        "start": "node index.js",
        "prepare": "husky install",
        "format": "prettier --write . && git add -A ."
      },
      "author": "Ryan Olf",
      "license": "MIT",
      "dependencies": {
        "concurrently": "^9.2.1",
        "nfc-pcsc": "^0.8.1",
        "nfccard-tool": "^0.1.1",
        "node-fetch": "^3.3.2",
        "sonos-http-api": "jishi/node-sonos-http-api"
      },
      "devDependencies": {
        "@babel/core": "^7.25.2",
        "@babel/preset-env": "^7.25.4",
        "babel-jest": "^29.7.0",
        "babel-plugin-transform-amd-to-commonjs": "^1.6.0",
        "husky": "^9.1.7",
        "jest": "^29.7.0",
        "jest-fetch-mock": "^3.0.3",
        "prettier": "^3.3.3"
      }
    }
    

    However, the requirement to run the project as sudo seems to be caused by the ACR122U reader not being compatible with 64-bit Trixie and isn't easily fixable.

    I'm purchasing a newer generation card reader and will see if this works better with 64-bit Trixie...

  2. ashenshugarRET commented on May 3, 2026

    @ashenshugarRET
    ContributorAuthor

    There seems to be a quirk in Trixie that results in the requirement to run this app with elevated permissions which I can't resolve. I've submitted a pull request #21 for your review, if you'd rather not merge it I understand

  3. ryanolf commented on May 3, 2026

    @ryanolf
    Owner
  4. added a commit that references this issue on Oct 3, 2026
    40994d5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions