guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Guix and Cordova


From: Daniel Pimentel
Subject: Re: Guix and Cordova
Date: Tue, 24 Mar 2015 21:43:51 -0300
User-agent: Roundcube Webmail/1.0.5

On 2015-03-24 12:57, Thompson, David wrote:
On Tue, Mar 24, 2015 at 7:40 AM, Daniel Pimentel <address@hidden> wrote:
Hi Guix, I installed NodeJs (node-0.12.0) that contain NPM (npm-2.5.1), so I tried install cordova in local profile (npm install cordova), but there's error when try execute cordova local binary (node_modules/.bin/cordova): bash: ./cordova: /usr/bin/env: bad interpreter: No such file or directory

GuixSD doesn't have a /usr/bin/env script, nor a /usr/bin directory.
Cordova shouldn't make this assumption.  If Cordova was built using
Guix, we could easily patch this shebang to refer to the version of
node that it was built with.  In the short-term, you should just patch
the script yourself and move on.  In the long term, the correct
solution is to package all of the nodejs libraries that Cordova needs
and make it a first-class Guix package.  Adding a nodejs build system
is the first step, and adding npm support to 'guix import' will
greatly simplify the task of writing node packages.  Are you
interested in helping out with this?

I tried global install (npm install -g cordova), but there're errors too:

62 error   fstream_path:
'/gnu/store/drs76938m19bdi98zjmpvw7i2fxv6gyr-node-0.12.0/lib/node_modules/cordova',
62 error   fstream_class: 'DirWriter',
62 error   fstream_stack:
62 error    [
'/gnu/store/drs76938m19bdi98zjmpvw7i2fxv6gyr-node-0.12.0/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
62 error
'/gnu/store/drs76938m19bdi98zjmpvw7i2fxv6gyr-node-0.12.0/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53',
62 error      'FSReqWrap.oncomplete (fs.js:99:15)' ] }
63 error Please try running this command again as root/Administrator.
64 verbose exit [ -13, true ]
65 verbose unbuild lib/node_modules/cordova
66 verbose gentlyRm vacuuming
/gnu/store/drs76938m19bdi98zjmpvw7i2fxv6gyr-node-0.12.0/lib/node_modules/cordova

A global install doesn't work because it's trying to write files into
the store like...


/gnu/store/drs76938m19bdi98zjmpvw7i2fxv6gyr-node-0.12.0/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js

...which is owned by root, so an unprivileged user cannot touch it.

And as root with sudo (sudo npm install -g cordova):
4 verbose stack     at Pipe.close (net.js:476:12)
5 verbose cwd /home/dani/Desktop/development/node
6 error Linux 3.18.9-gnu
7 error argv
"/gnu/store/drs76938m19bdi98zjmpvw7i2fxv6gyr-node-0.12.0/bin/node"
"/home/dani/.guix-profile/bin/npm" "install" "-g" "cordova"
8 error node v0.12.0
9 error npm  v2.5.1
10 error setuid user id does not exist
11 error If you need help, you may report this error at:
11 error     <http://github.com/npm/npm/issues>
12 verbose exit [ 1, true ]

I'm not sure what's going on here, but the result, had this worked,
would have been very bad.  You would corrupt your store entry for node
with node module files. Not good.

I can't emphasize this point enough: GuixSD does not use the FHS[0],
so you are bound to run into assumptions made by upstream software
developers that are problematic on GuixSD.

Hope this helps!

[0] https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard

- Dave
Thanks Dave, I would like help it.
--
Daniel Pimentel (d4n1)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]