Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/empjustine/nodejs-flake

npm and yarn versions that respect your environment provided node.
https://github.com/empjustine/nodejs-flake

nix-flake nixlang npm npmjs yarn

Last synced: about 2 months ago
JSON representation

npm and yarn versions that respect your environment provided node.

Awesome Lists containing this project

README

        

# nodejs-flake

`npm`, `yarn` and `pnpm` versions that respect your environment provided `node`.

Assuming:

* You have a `/usr/bin/env`;
* You want a nix flake package of `npm`, `yarn` or `pnpm`;
* You want a fixed, specific version of `npm`, `yarn` or `pnpm`, that is not the one bundled in your `nodejs` package;
* You want that the fixed version of `npm`, `yarn` or `pnpm` to use the same `node` that you have on your `$PATH` environment;
* You somehow locked your `node` somewhere else:
* nix flakes;
* jetpack-io/devbox;
* volta;
* pnpm;

This might fit your bill.

## Usage

Pick your `npm`/`yarn`/`pnpm` version. Because of limitations on `nixpkgs pname`s, `period`s and the `at sign` are underlines.

# let's assume you need [email protected]
# [email protected] -> npm-9.9.2 -> npm-9_9_2

# probably a terrible idea:
nix --extra-experimental-features 'nix-command flakes' profile install 'github:empjustine/nodejs-flake/v2#npm-9_9_2'

# a better idea
devbox add 'github:empjustine/nodejs-flake/v2#npm-9_9_2'