How should I be running `npm install …`?

2020-04-30 Thread Josh Marshall
Hello all,

The is my work email, I’m usually on IRC as “anadon”.  My laptop broke, so 
please humor the account change.

Following the guide at 
https://medium.com/jeremy-keeshin/hello-world-for-javascript-with-npm-modules-in-the-browser-6020f82d1072
 , I’m trying to run `npm install -g browserify` with the output below.  This 
is something others have certainly run into, but a quick google search does not 
turn up any useful results.  How should I be doing this?


```
npm WARN checkPermissions Missing write access to 
/gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules   
  npm ERR! code EACCES  
  npm ERR! syscall access   
  npm ERR! path 
/gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules   
  npm ERR! 
errno -13  npm ERR! 
Error: EACCES: permission denied, access 
'/gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules' 
  npm ERR!  { [Error: EACCES: permission denied, 
access 
'/gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules']
  npm ERR!   stack: 
  npm ERR!'Error: EACCES: permission denied, access 
\'/gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules\'', 
  npm ERR!   errno: -13,
  npm ERR!   code: 'EACCES',
  npm ERR!   syscall: 'access', 
  npm ERR!   path:  
  npm ERR!
'/gnu/store/39zkw3a8lxkxs7rmx4238959zc368075-node-10.19.0/lib/node_modules' }   
npm ERR!
npm ERR! 
The operation was rejected by your operating system.   npm ERR! 
It is likely you do not have the permissions to access this file as the current 
user   npm ERR! 
   npm ERR! 
If you believe this might be a permissions issue, please double-check the   
   npm ERR! 
permissions of the file and its containing directories, or try running npm ERR! 
the command again as root/Administrator.
   npm ERR! 
A complete log of this run can be found in:npm ERR! 
/home/marshjo/.npm/_logs/2020-04-30T14_50_56_150Z-debug.log
```
---

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.


Re: How should I be running `npm install …`?

2020-04-30 Thread Vivien Kraus
Hello!

Le jeudi 30 avril 2020 à 14:59 +, Josh Marshall a écrit :
> Hello all,
> 
> The is my work email, I’m usually on IRC as “anadon”.  My laptop
> broke, so please humor the account change.
> 
> Following the guide at 
> https://medium.com/jeremy-keeshin/hello-world-for-javascript-with-npm-modules-in-the-browser-6020f82d1072
> , I’m trying to run `npm install -g browserify` with the output
> below.  This is something others have certainly run into, but a quick
> google search does not turn up any useful results.  How should I be
> doing this?

I am a mere guix user, so you may want to have another answer.

You cannot install anything globally with NPM in guix, because NPM is
installed in a read-only location (/gnu/store/).  This is required for
guix to work correctly.

You can use this trick:
https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

Basically, it tells NPM to install to your home directory.  So that it
is still installed in a central location, but this location is read-
write.

Vivien




RE: [EXTERNAL]Re: How should I be running `npm install …`?

2020-04-30 Thread Josh Marshall
This gets me what I need – thanks!


From: Vivien Kraus 
Sent: Thursday, April 30, 2020 11:06:15 AM
To: Josh Marshall ; help-guix 
Subject: [EXTERNAL]Re: How should I be running `npm install …`?

Hello!

Le jeudi 30 avril 2020 à 14:59 +, Josh Marshall a écrit :
> Hello all,
>
> The is my work email, I’m usually on IRC as “anadon”.  My laptop
> broke, so please humor the account change.
>
> Following the guide at
> https://medium.com/jeremy-keeshin/hello-world-for-javascript-with-npm-modules-in-the-browser-6020f82d1072
> , I’m trying to run `npm install -g browserify` with the output
> below.  This is something others have certainly run into, but a quick
> google search does not turn up any useful results.  How should I be
> doing this?

I am a mere guix user, so you may want to have another answer.

You cannot install anything globally with NPM in guix, because NPM is
installed in a read-only location (/gnu/store/).  This is required for
guix to work correctly.

You can use this trick:
https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md

Basically, it tells NPM to install to your home directory.  So that it
is still installed in a central location, but this location is read-
write.

Vivien

---

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.


Re: How should I be running `npm install …`?

2020-04-30 Thread Jelle Licht
Hey Josh,


Josh Marshall  writes:

> Hello all,
>
> The is my work email, I’m usually on IRC as “anadon”.  My laptop broke, so 
> please humor the account change.
>
> Following the guide at 
> https://medium.com/jeremy-keeshin/hello-world-for-javascript-with-npm-modules-in-the-browser-6020f82d1072
>  , I’m trying to run `npm install -g browserify` with the output below.  This 
> is something others have certainly run into, but a quick google search does 
> not turn up any useful results.  How should I be doing this?

By default, guix' npm wants to install to some location in the store,
which is mounted read-only. If you want to use npm to manage package
installations on guix, one workaround is to add something like the
following to your `$HOME/.npmrc':

--8<---cut here---start->8---
prefix=/home/anadon/opt
--8<---cut here---end--->8---

You also need to make sure that `$HOME/opt/bin' is in your path
afterwards.

HTH,
 - Jelle