From owner-freebsd-questions@freebsd.org Sat Oct 17 10:35:23 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B76B3A16E23 for ; Sat, 17 Oct 2015 10:35:23 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from ms-10.1blu.de (ms-10.1blu.de [178.254.4.101]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71EE620F for ; Sat, 17 Oct 2015 10:35:22 +0000 (UTC) (envelope-from guru@unixarea.de) Received: from [93.104.11.5] (helo=localhost.unixarea.de) by ms-10.1blu.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.76) (envelope-from ) id 1ZnOpU-0005Uv-Sx; Sat, 17 Oct 2015 12:35:13 +0200 Received: from localhost.my.domain (c720-r276659 [127.0.0.1]) by localhost.unixarea.de (8.14.9/8.14.9) with ESMTP id t9HAZAgE002803 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 17 Oct 2015 12:35:11 +0200 (CEST) (envelope-from guru@unixarea.de) Received: (from guru@localhost) by localhost.my.domain (8.14.9/8.14.9/Submit) id t9HAZAWN002802; Sat, 17 Oct 2015 12:35:10 +0200 (CEST) (envelope-from guru@unixarea.de) X-Authentication-Warning: localhost.my.domain: guru set sender to guru@unixarea.de using -f Date: Sat, 17 Oct 2015 12:35:10 +0200 From: Matthias Apitz To: Polytropon Cc: freebsd-questions@freebsd.org Subject: Re: GitBook on FreeBSD? Message-ID: <20151017103510.GB2597@c720-r276659> Reply-To: Matthias Apitz Mail-Followup-To: Matthias Apitz , Polytropon , freebsd-questions@freebsd.org References: <20151016064251.GA1975@c720-r276659> <86mvvjymhd.fsf@WorkBox.Home> <20151016183244.GA21879@c720-r276659> <20151017012617.3bc51864.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20151017012617.3bc51864.freebsd@edvax.de> X-Operating-System: FreeBSD 11.0-CURRENT r269739 (i386) User-Agent: Mutt/1.5.23 (2014-03-12) X-Con-Id: 51246 X-Con-U: 0-guru X-Originating-IP: 93.104.11.5 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Oct 2015 10:35:23 -0000 El día Saturday, October 17, 2015 a las 01:26:17AM +0200, Polytropon escribió: > On Fri, 16 Oct 2015 20:32:45 +0200, Matthias Apitz wrote: > > > > Thanks. I have installed www/npm and run: > > > > $ npm install gitbook-cli -g > > npm ERR! FreeBSD 11.0-CURRENT > > npm ERR! argv "node" "/usr/local/bin/npm" "install" "gitbook-cli" "-g" > > npm ERR! node v0.10.32 > > npm ERR! npm v2.0.2 > > npm ERR! path /usr/local/lib/node_modules/gitbook-cli > > npm ERR! code EACCES > > npm ERR! errno 3 > > > > npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/gitbook-cli' > > npm ERR! { [Error: EACCES, mkdir > > '/usr/local/lib/node_modules/gitbook-cli'] > > npm ERR! errno: 3, > > npm ERR! code: 'EACCES', > > npm ERR! path: '/usr/local/lib/node_modules/gitbook-cli', > > npm ERR! fstream_type: 'Directory', > > npm ERR! fstream_path: '/usr/local/lib/node_modules/gitbook-cli', > > npm ERR! fstream_class: 'DirWriter', > > npm ERR! fstream_stack: > > npm ERR! [ > > '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23', > > npm ERR! > > '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53', > > npm ERR! 'Object.oncomplete (fs.js:107:15)' ] } > > npm ERR! > > npm ERR! Please try running this command again as root/Administrator. > > ... > > > > Is it safe to run this as root? > > ... > > On the other hand, couldn't you specify a path local to your user > account (e. g., ~/node_modules) for a local installation of the > gitbook-cli package? As you see above, I tried it as a normal user und chown'ed the top level dir /usr/local/lib/node_modules to his (mine) owner. This gives the above errors. When I run the mkdir(1) from the shell as a normal user, it works fine: $ mkdir '/usr/local/lib/node_modules/gitbook-cli' $ ls -ld /usr/local/lib/node_modules/gitbook-cli drwxr-xr-x 2 guru wheel 512 17 oct 12:15 /usr/local/lib/node_modules/gitbook-cli I do not understand, why npm is unwilling todo its job as normal user. When I even set 0777 perms to the dir /usr/local/lib/node_modules it gives: $ npm install gitbook-cli -g npm ERR! FreeBSD 11.0-CURRENT npm ERR! argv "node" "/usr/local/bin/npm" "install" "gitbook-cli" "-g" npm ERR! node v0.10.32 npm ERR! npm v2.0.2 npm ERR! path ../lib/node_modules/gitbook-cli/bin/gitbook.js npm ERR! code EACCES npm ERR! errno 3 npm ERR! Error: EACCES, symlink '../lib/node_modules/gitbook-cli/bin/gitbook.js' npm ERR! { [Error: EACCES, symlink '../lib/node_modules/gitbook-cli/bin/gitbook.js'] npm ERR! errno: 3, npm ERR! code: 'EACCES', npm ERR! path: '../lib/node_modules/gitbook-cli/bin/gitbook.js' } npm ERR! npm ERR! Please try running this command again as root/Administrator. It installes some thousand file below this dir, but nothing for 'gitbook': $ find /usr/local/lib/node_modules | wc -l 2283 $ find /usr/local/lib/node_modules | fgrep gitbook $ +Cc: sunpoet@FreeBSD.org (MAINTAINER of www/npm) > Of course it's a little bit problematic when several package > managers (others than the system's pkg) want to write stuff to > system-level directories. And npm isn't the only example I could > think of... Yes, very problematic. matthias -- Matthias Apitz, ✉ guru@unixarea.de, 🌐 http://www.unixarea.de/ ☎ +49-176-38902045