In NixOS, I installed the package yarn
as usual by running $ nix-env -i yarn
. Now I am attempting to run yarn
via $ yarn start
. But this leads me to the following error.
$ yarn start
yarn start v0.20.3
$ webpack-dev-server --env dev
sh: webpack-dev-server: command not found
error Command failed with exit code 127.
When I try to install webpack-dev-server
in my usual NixOS way I get a 'matches no derivations' error.
$ nix-env -i webpack-dev-server
error: selector ‘webpack-dev-server’ matches no derivations
I read that webpack-dev-server
is an npm package, and am unsure of a couple questions regarding the relevance of that in this case.
- Does it make sense to use npm, a different package manager than nix, under Nix?
- If answer to (1) is yes, then how to install npm on NixOS? I do not
see npm available when searching via
nix-env
, as$ nix-env -qa npm
also matches no derivations.
What is the correct way to install webpack-dev-server
on NixOS?
EDIT
I attempted to install webpack-dev-server
following the commented link and was able to install node2nix
, but am not able to follow through on step 2 listed in the readme there.
I located the file referenced in step 2 in /nix/store
at
/nix/store/sgk7sxgqxrv2axkxjwc3y15apcqbrv1z-nixos-17.03.1482.1b57bf274a/nixos/pkgs/development/node-packages/node-packages.json
I can open that file to view the npm packages listed, but the permissions are read-only, even running with sudo -- so I would need to edit it's permissions in order to alter it.
It seems that I should not be editing this /nix/store
file directly and should instead be manipulating it indirectly via nix. Am I correct that I should not be editing this file directly? If so, how else can I complete step 2 by using nix or something to add webpack-dev-server
to it?
/nix/store
is read-only. You need to clone git repo and use-I nixpkgs=/path/to/repo
fornix-*
command