[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Web development on Guix: nodejs, npm and all that
From: |
Jelle Licht |
Subject: |
Re: Web development on Guix: nodejs, npm and all that |
Date: |
Tue, 11 Jan 2022 00:08:29 +0100 |
t@fullmeta.me writes:
>> I haven't encountered any npm package which doesn't work when not
>> installed globally yet and it seems to me that would be a bug in said
>> package.
>
> this is certainly great to hear! Thank you
>
> I've been trying to do all setup via `guix shell --container`. Is there an
> easy (obvious) way to extend environment inside the container? I can
> --preserve etc, but doesn't look like I can easily change e.g. PATH to ensure
> it includes local node_modules/bin. Maybe the better way would be to have the
> ability to set GUIX_ENVIRONMENT to a profile that you tweak which sets env
> vars apprpiately. I feel like maybe I'm already asking too much of the guix
> shell CLI front end and maybe I'm better of reversing what relevant .scm
> script does setting up container's environment and just drop my modified .scm
> script to a project dir. I hate mucking with BASH and such - never ends well
> and never goes smoothly.
Would prefixing your commands with 'npx' work? I can't recall any major
issues running some tools that were installed in node_modules/bin via
guix's node/npm.
>
> Anyone has suggestions? Basically at this point we are trying to go slightly
> above what `guix shell --container` or even `guix shell` can do. Something
> that I feel amounts to (in non-guix world) to running a sort of .loginrc
> script when you enter the environment or container.
I don't believe there is a clean solution for doing these things, but
you can probably cobble something together with bash and the --expose
flag of 'guix shell'
As other folks mentioned, this does seem more easily solved using
direnv, so that's probably what I would go for.
- Jelle