Mongo-hacker error while installing

Asked

Viewed 692 times

0

I am trying to install the Mongo-hacker on my pc, but getting an error that I cannot unravel. Follows what the terminal returns me:

gabriel@Constantine:~$ npm install -g mongo-hacker
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/mongo-hacker'
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/mongo-hacker']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/mongo-hacker',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/mongo-hacker',
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.

npm ERR! System Linux 3.2.0-67-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "mongo-hacker"
npm ERR! cwd /home/gabriel
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! path /usr/local/lib/node_modules/mongo-hacker
npm ERR! fstream_path /usr/local/lib/node_modules/mongo-hacker
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/mongo-hacker'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/gabriel/npm-debug.log
npm ERR! not ok code 0

Mongodb shell version: 2.6.4

Distro: Elementary OS

In the attempt with super user npm returns me other errors:

[email protected] install /usr/local/lib/node_modules/mongo-hacker
> make all

cat > mongo_hacker.js base.js config.js hacks/aggregation.js hacks/api.js hacks/auto_complete.js hacks/cmd_search.js hacks/color.js hacks/common.js hacks/find_and_modify.js hacks/helpers.js hacks/index_paranoia.js hacks/old_aggregation.js hacks/prompt.js hacks/show_dbs.js hacks/sh_status.js hacks/uuid.js hacks/verbose.js
INSTALLATION
Linking MongoHacker to .mongorc.js in your home directory:
make[1]: Entrando no diretório `/usr/local/lib/node_modules/mongo-hacker'
rm -f ~/.mongorc.js
rm: não foi possível remover “/home/gabriel/.mongorc.js”: Permissão negada
make[1]: ** [uninstall] Erro 1
make[1]: Saindo do diretório `/usr/local/lib/node_modules/mongo-hacker'
make: ** [install] Erro 2

> [email protected] postuninstall /usr/local/lib/node_modules/mongo-hacker
> make uninstall

rm -f ~/.mongorc.js
rm: não foi possível remover “/home/gabriel/.mongorc.js”: Permissão negada
make: ** [uninstall] Erro 1
npm WARN continuing anyway [email protected] postuninstall: `make uninstall`
npm WARN continuing anyway Exit status 2
npm ERR! [email protected] install: `make all`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the mongo-hacker package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     make all
npm ERR! You can get their info via:
npm ERR!     npm owner ls mongo-hacker
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.2.0-67-generic
npm ERR! command "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "mongo-hacker"
npm ERR! cwd /home/gabriel
npm ERR! node -v v0.10.31
npm ERR! npm -v 1.4.23
npm ERR! code ELIFECYCLE
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/gabriel/npm-debug.log
npm ERR! not ok code 0
  • 2

    Came to test using sudo? Apparently he wasn’t allowed to create the directory /usr/local/lib/node_modules/mongo-hacker, see message: Error: EACCES, mkdir '/usr/local/lib/node_modules/mongo-hacker'

  • I tried, but you’re still wrong.

1 answer

3

To install packages from npm globally (the -g that you used) it is necessary to elevate yourself to super user. Use the sudo for that reason:

sudo npm install -g mongo-hacker

Browser other questions tagged

You are not signed in. Login or sign up in order to post.