unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: Dejan Ranisavljevic <dejan@ranisavljevic.com>
To: Gary Johnson <lambdatronic@disroot.org>
Cc: Dmitry Alexandrov <321942@gmail.com>,
	Josh Marshall <Josh.Marshall@jax.org>,
	Vivien Kraus <vivien@planete-kraus.eu>,
	help-guix@gnu.org
Subject: Re: How should I be running `npm install …`?
Date: Wed, 17 Jun 2020 06:09:57 +0200	[thread overview]
Message-ID: <CANK8WYOCzbYLDxZWOcGy-CqnizHNDS6iKYXNouaZd21qDJKt+w@mail.gmail.com> (raw)
In-Reply-To: <87r1ufghpk.fsf@disroot.org>

To use different directory for global packages, you have to create ~/.npmrc
dotfile with:

prefix=~/.npm

Once you have that you should be able to do npm i -g, and package would be
installed in ~/.npm
Also don't forget to add ~/.npm/bin in your PATH:

export PATH="$HOME/.npm/bin:$PATH"

Hope this helps.

Best,
Dejan

On Tue, 16 Jun 2020 at 17:21, Gary Johnson <lambdatronic@disroot.org> wrote:

> In Guix, all system-level packages and configuration files are created
> by the package manager under /gnu/store. The /usr directory is empty on
> a Guix system.
>
> ~Gary
>
> Dmitry Alexandrov <321942@gmail.com> writes:
>
> > Vivien Kraus <vivien@planete-kraus.eu> wrote:
> >> Le jeudi 30 avril 2020 à 14:59 +0000, Josh Marshall a écrit :
> >>> I’m trying to run `npm install -g browserify` with the output below.
> >
> >>> npm ERR! path
> /gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules
> >>
> >> I am a mere guix user, so you may want to have another answer.
> >
> > I am not even a Guix (the SD) user, but this made me curious.
> >
> >> You cannot install anything globally with NPM in guix because NPM is
> installed in a read-only location (/gnu/store/)
> >
> > So?  /usr/ in traditional GNU distributions might be read-only as well,
> but it does not impede npm(1) or pip(1) or whatever install things
> system-wide (given that operator utilize his superuser powers, of course),
> as there are plenty other hierarchies available.
> >
> > Why is npm in Guix built with default ‘prefix’¹ (means, for --global
> actions) set to package directory under /gnu/store/ instead of, say,
> /usr/local?
> >
> > ---
> > ¹
> >       $ npm config get prefix
>
>
> --
> GPG Key ID: 7BC158ED
> Use `gpg --search-keys lambdatronic' to find me
> Protect yourself from surveillance: https://emailselfdefense.fsf.org
> =======================================================================
> ()  ascii ribbon campaign - against html e-mail
> /\  www.asciiribbon.org   - against proprietary attachments
>
> Please avoid sending me MS-Office attachments.
> See http://www.gnu.org/philosophy/no-word-attachments.html
>
>

  parent reply	other threads:[~2020-06-17 11:10 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-30 14:59 How should I be running `npm install …`? Josh Marshall
2020-04-30 15:06 ` Vivien Kraus
2020-04-30 15:13   ` [EXTERNAL]Re: " Josh Marshall
2020-05-02  7:40   ` Dmitry Alexandrov
2020-06-16 15:20     ` Gary Johnson
2020-06-16 21:06       ` Dmitry Alexandrov
2020-06-17  4:09       ` Dejan Ranisavljevic [this message]
2020-06-17 14:58         ` [EXTERNAL]Re: " Josh Marshall
2020-04-30 15:18 ` Jelle Licht

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=CANK8WYOCzbYLDxZWOcGy-CqnizHNDS6iKYXNouaZd21qDJKt+w@mail.gmail.com \
    --to=dejan@ranisavljevic.com \
    --cc=321942@gmail.com \
    --cc=Josh.Marshall@jax.org \
    --cc=help-guix@gnu.org \
    --cc=lambdatronic@disroot.org \
    --cc=vivien@planete-kraus.eu \
    /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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).