From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Thompson, David" Subject: Re: Guix and Cordova Date: Tue, 24 Mar 2015 11:57:41 -0400 Message-ID: References: <7df28faa6f1669392501829422eb137c@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58545) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaRDa-00068x-3U for guix-devel@gnu.org; Tue, 24 Mar 2015 11:58:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YaRDV-0002PA-1E for guix-devel@gnu.org; Tue, 24 Mar 2015 11:58:14 -0400 Received: from na3sys009aog128.obsmtp.com ([74.125.149.141]:59025 helo=mail-pa0-f50.google.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YaRDU-0002Nv-QP for guix-devel@gnu.org; Tue, 24 Mar 2015 11:58:08 -0400 Received: by padcy3 with SMTP id cy3so229681062pad.3 for ; Tue, 24 Mar 2015 08:57:42 -0700 (PDT) In-Reply-To: <7df28faa6f1669392501829422eb137c@openmailbox.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Daniel Pimentel Cc: guix-devel On Tue, Mar 24, 2015 at 7:40 AM, Daniel Pimentel 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 > 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