GitBook on FreeBSD?
Matthias Apitz
guru at unixarea.de
Sat Oct 17 10:35:23 UTC 2015
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 at 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 at unixarea.de, 🌐 http://www.unixarea.de/ ☎ +49-176-38902045
More information about the freebsd-questions
mailing list