That does help, but it ought to be the default in many ways.

From: Dejan Ranisavljevic<mailto:[email protected]>
Sent: Wednesday, June 17, 2020 12:10 AM
To: Gary Johnson<mailto:[email protected]>
Cc: Dmitry Alexandrov<mailto:[email protected]>; Josh 
Marshall<mailto:[email protected]>; 
[email protected]<mailto:[email protected]>; Vivien 
Kraus<mailto:[email protected]>
Subject: [EXTERNAL]Re: How should I be running `npm install …`?

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 
<[email protected]<mailto:[email protected]>> 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 <[email protected]<mailto:[email protected]>> writes:

> Vivien Kraus <[email protected]<mailto:[email protected]>> 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<http://www.asciiribbon.org>   - against proprietary 
attachments

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html

---

The information in this email, including attachments, may be confidential and 
is intended solely for the addressee(s). If you believe you received this email 
by mistake, please notify the sender by return email as soon as possible.

Reply via email to