unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Thompson, David" <dthompson2@worcester.edu>
To: Daniel Pimentel <d4n1@openmailbox.org>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: Guix and Cordova
Date: Tue, 24 Mar 2015 11:57:41 -0400	[thread overview]
Message-ID: <CAJ=RwfZVUA6v301XG6XrhJ1+YHReoOEWLJQce+7LRnmgjvhBPw@mail.gmail.com> (raw)
In-Reply-To: <7df28faa6f1669392501829422eb137c@openmailbox.org>

On Tue, Mar 24, 2015 at 7:40 AM, Daniel Pimentel <d4n1@openmailbox.org> 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

  reply	other threads:[~2015-03-24 15:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 11:40 Guix and Cordova Daniel Pimentel
2015-03-24 15:57 ` Thompson, David [this message]
2015-03-25  0:43   ` Daniel Pimentel

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='CAJ=RwfZVUA6v301XG6XrhJ1+YHReoOEWLJQce+7LRnmgjvhBPw@mail.gmail.com' \
    --to=dthompson2@worcester.edu \
    --cc=d4n1@openmailbox.org \
    --cc=guix-devel@gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

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