Error installing npm packages globally

I am trying to install gitmoji-cli npm package globally on my nixos, but am getting few errors

Here is the content of the error log file

What am i doing wrong, and is there any fix? Any help regarding this is appreciated.

The Nix store is immutable, so you can only install packages globally using Nix. To use this package, you can install it in your home directory and add it to your path. You can also create a Nix package for it and globally install it using that.

2 Likes

You can also create a Nix package for it and globally install it using that.

As in adding nodePackages.gitmoji-cli to the configuration.nix file?

You would need to write a package for it, one does not currently exist. The Nixpkgs manual has a section on packaging a node application: Nixpkgs 23.11 manual | Nix & NixOS

1 Like

For the package I want to install, there is a package on the Nixstore. Maybe for any other node package, i need to create a package manually

Thanks mate