all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Wojtek Kosior via <help-guix@gnu.org>
To: jordi <jordila@librebits.info>
Cc: help-guix <help-guix@gnu.org>
Subject: Re: npm 'command not found' while node js is installed ?
Date: Wed, 19 Oct 2022 21:34:30 +0200	[thread overview]
Message-ID: <20221019213430.0aac4464@koszkonutek-tmp.pl.eu.org> (raw)
In-Reply-To: <Y09XnuCvbgoLtLnz@mercurio>

[-- Attachment #1: Type: text/plain, Size: 2086 bytes --]

> Hi Guixers,
> 
>   I installed nodejs package. 
> When i go 'npm' in the shell i'm getting a 'command not found' error message.
> 
> how to get 'npm' working ? what am i missing ?
> 
> thanks, thanks, thanks
> 
> Fenix

Hi there,

I suppose you're that either
* you're using some Guix version that does not include the npm command
  in `node` package or
* you don't have Guix profile's `bin/` directory in your PATH variable.

The second seems more likely. I don't know if the first one is
possible, actually (I have no clue about the history of `node` package).

Try

    guix shell -C node -- npm --help

to verify that npm is available in your current Guix version. You
perhaps realize what this command does. Just in case - it runs
`npm --help` in a container. If it works (i.e. npm's `--help` output is
printed), it means your PATH variable did not contain the path to the
profile with npm and that was the cause of your problem. Fix it by
editing your shell initialization files. These are e.g. `~/.bashrc` and
`~/.profile`. Or others depending on the shell you're using.

Btw, you can verify that npm is indeed present in Guix by running

    guix time-machine --commit=a86979b41a49a8fcdaa887970ba594dbba701226 -- shell -C node -- npm --help

This will use a fixed version of Guix to run npm in a container. But
this way neither incorrectly initialized PATH variable nor outdated
`node` package will be able to cause you problems. The `time-machine`
command might take some time to finish upon the first run... I'm giving
it here as an interesting example - you shouldn't need `time-machine`
for merely installing npm :)

Please tell if you managed to fix the problem

Good luck,
Wojtek

-- (sig_start)
website: https://koszko.org/koszko.html
PGP: https://koszko.org/key.gpg
fingerprint: E972 7060 E3C5 637C 8A4F  4B42 4BC5 221C 5A79 FD1A

Meet Kraków saints!           #11: saint Jacek Odrowąż
Poznaj świętych krakowskich!  #11: święty Jacek Odrowąż
https://pl.wikipedia.org/wiki/Jacek_Odrowąż
-- (sig_end)

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      reply	other threads:[~2022-10-19 19:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19  1:49 npm 'command not found' while node js is installed ? jordi
2022-10-19 19:34 ` Wojtek Kosior via [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221019213430.0aac4464@koszkonutek-tmp.pl.eu.org \
    --to=help-guix@gnu.org \
    --cc=jordila@librebits.info \
    --cc=koszko@koszko.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.