unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* How to work with npm from guix shell
@ 2022-02-18 12:27 Roland Everaert via
  2022-02-18 12:37 ` Ekaitz Zarraga
  2022-02-18 12:43 ` Martin Castillo
  0 siblings, 2 replies; 4+ messages in thread
From: Roland Everaert via @ 2022-02-18 12:27 UTC (permalink / raw)
  To: Roland Everaert via

Hello,

I try to install the community server of the solid project using the following documentation in a guix shell session.

https://solidproject.org//self-hosting/css

Unfortunatelly I got the following error during the execution of 'npm install -g @solid/community-server'

----------------------------------
npm WARN checkPermissions Missing write access to /gnu/store/5h6v8gkyzc4xlvl96qp4apmjxar5br76-node-14.18.3/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /gnu/store/5h6v8gkyzc4xlvl96qp4apmjxar5br76-node-14.18.3/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/gnu/store/5h6v8gkyzc4xlvl96qp4apmjxar5br76-node-14.18.3/lib/node_modules'
npm ERR! [Error: EACCES: permission denied, access '/gnu/store/5h6v8gkyzc4xlvl96qp4apmjxar5br76-node-14.18.3/lib/node_modules'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'access',
npm ERR! path: '/gnu/store/5h6v8gkyzc4xlvl96qp4apmjxar5br76-node-14.18.3/lib/node_modules'
npm ERR! }
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/roland/.npm/_logs/2022-02-18T12_10_31_439Z-debug.log-------------------------------------

Command use to start the guix shell session.

guix shell -CN node

I am totally illiterate about node.js and its ecosystem. So, how to setup a proper environment for running node.js application with guix shell or guix in general?

I am running the application in a guix shell session for testing purposes.

Roland Everaert
---
Use the F.O.S.S., Luke

Sent with [ProtonMail](https://protonmail.com/) Secure Email.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to work with npm from guix shell
  2022-02-18 12:27 How to work with npm from guix shell Roland Everaert via
@ 2022-02-18 12:37 ` Ekaitz Zarraga
  2022-02-22 12:55   ` Roland Everaert
  2022-02-18 12:43 ` Martin Castillo
  1 sibling, 1 reply; 4+ messages in thread
From: Ekaitz Zarraga @ 2022-02-18 12:37 UTC (permalink / raw)
  To: Roland Everaert; +Cc: Roland Everaert via

Hi

> Hello,
>
> I try to install the community server of the solid project using the following documentation in a guix shell session.
>
> https://solidproject.org//self-hosting/css
>
> Unfortunatelly I got the following error during the execution of 'npm install -g @solid/community-server'

This command installs stuff globally, which tries to access system's directories and that's what's giving you the error (the store is immutable).
What I suggest is to remove the -g so the packages are going to be installed in the current folder under node_modules, and you'll be able to run them by their path:

./node_modules/community-server/bin/whatever

You can also add that to the PATH and simplify some things.
That's what I do.

But there might be other better options, like setting where should npm install the packages globally? I don't know about that.

Hope that helps



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to work with npm from guix shell
  2022-02-18 12:27 How to work with npm from guix shell Roland Everaert via
  2022-02-18 12:37 ` Ekaitz Zarraga
@ 2022-02-18 12:43 ` Martin Castillo
  1 sibling, 0 replies; 4+ messages in thread
From: Martin Castillo @ 2022-02-18 12:43 UTC (permalink / raw)
  To: help-guix

Hi,

Am 18.02.22 um 13:27 schrieb Roland Everaert via:
> Unfortunatelly I got the following error during the execution of 'npm install -g @solid/community-server'

The -g flag tells npm that you want to install the package globaly, 
which on guix, is inside the read-only gnu store.
You can either just omit -g to install the packages in the current 
directory, or use 
<https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md>, 
which was proposed here: 
<https://yhetil.org/guix-user/87zhatypbh.fsf@jlicht.xyz/t/>

> 
> I am totally illiterate about node.js and its ecosystem. So, how to setup a proper environment for running node.js application with guix shell or guix in general?

Guix packages packages from other language specific packagers, like pip. 
But I don't think we have node modules tracked by guix.
AFAIK, the above solution is best practice.

Someone else might know more.

Martin


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to work with npm from guix shell
  2022-02-18 12:37 ` Ekaitz Zarraga
@ 2022-02-22 12:55   ` Roland Everaert
  0 siblings, 0 replies; 4+ messages in thread
From: Roland Everaert @ 2022-02-22 12:55 UTC (permalink / raw)
  To: Ekaitz Zarraga; +Cc: Roland Everaert via

Hello,

Removing the '-g' option allows me to go further, however, I encounter some dependency problems.

I will get in touch with the project maintainer to get more help.

BTW, is there any articles that go in depth with the use of guix shell?

I have still difficulties to get en environment right and to understand all the subtelties of the available options for the command.

Thanks for the help,

Roland Everaert
---
Use the F.O.S.S., Luke

Sent with ProtonMail Secure Email.

------- Original Message -------

Le vendredi 18 février 2022 à 13:37, Ekaitz Zarraga <ekaitz@elenq.tech> a écrit :

> Hi
>
> > Hello,
> >
> > I try to install the community server of the solid project using the following documentation in a guix shell session.
> >
> > https://solidproject.org//self-hosting/css
> >
> > Unfortunatelly I got the following error during the execution of 'npm install -g @solid/community-server'
>
> This command installs stuff globally, which tries to access system's directories and that's what's giving you the error (the store is immutable).
>
> What I suggest is to remove the -g so the packages are going to be installed in the current folder under node_modules, and you'll be able to run them by their path:
>
> ./node_modules/community-server/bin/whatever
>
> You can also add that to the PATH and simplify some things.
>
> That's what I do.
>
> But there might be other better options, like setting where should npm install the packages globally? I don't know about that.
>
> Hope that helps


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-22 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18 12:27 How to work with npm from guix shell Roland Everaert via
2022-02-18 12:37 ` Ekaitz Zarraga
2022-02-22 12:55   ` Roland Everaert
2022-02-18 12:43 ` Martin Castillo

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).