question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot create mongo_hacker.js: Permission denied

See original GitHub issue

on Debian 8, Node v8.4.0, Npm v 5.3.0

run by root…

# npm install -g mongo-hacker

> mongo-hacker@0.0.15 install /usr/lib/node_modules/mongo-hacker
> make install

cat config.js base.js hacks/color.js hacks/common.js hacks/aggregation.js hacks/old_aggregation.js hacks/uuid.js hacks/find_and_modify.js hacks/prompt.js hacks/auto_complete.js hacks/dbref.js hacks/helpers.js hacks/cmd_search.js hacks/show.js hacks/ps.js hacks/verbose.js hacks/randomise.js hacks/api.js hacks/index_paranoia.js hacks/sh_status.js hacks/count.js > mongo_hacker.js
/bin/sh: 1: cannot create mongo_hacker.js: Permission denied
Makefile:10: recipe for target 'mongo_hacker.js' failed
make: *** [mongo_hacker.js] Error 2
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! mongo-hacker@0.0.15 install: `make install`
npm ERR! Exit status 2
npm ERR! 
npm ERR! Failed at the mongo-hacker@0.0.15 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-09-05T18_09_50_908Z-debug.log

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

9reactions
jwerrecommented, Oct 5, 2017

This worked for me:

$ sudo chmod 777 /usr/local/lib/node_modules
$ npm install -g mongo-hacker
$ sudo chmod 755 /usr/local/lib/node_modules
7reactions
adamelliotfieldscommented, Apr 20, 2018

sudo npm install --global --unsafe-perm mongo-hacker

Post-install scripts are normally prohibited by root (for good reason); the --unsafe-perm flag allows these scripts to run.

If you can, use NVM instead of installing Node directly, as NVM will let you run npm install --global without sudo.

On my Mac with NVM, npm install --global mongo-hacker works fine 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Permission denied error trying to install Mongo-Hacker?
Failed at the mongo-hacker@0.0.15 install script 'make install'. npm ... rm: /Users/stephanierichter/.mongorc.js: Permission denied make: ...
Read more >
Installation permission problems · Issue #154 · TylerBrock/mongo ...
Failed at the mongo-hacker@0.0.12 install script 'make install'. npm ERR! ... cannot create mongo_hacker.js: Permission denied #176.
Read more >
permission denied for mongodb container error while running ...
EDIT: Your issue is container / host permissions. This answer might help. ORIGINAL ANSWER: Will keeping MongoDb in my local as well as...
Read more >
Permission denied message while running mongo command ...
Hi, I am following the Developer certificate course. From the Chapter 2, I followed the video to install mongo shell.
Read more >
.mongorc.js' failed with errno:13 Permission denied
I deleted that file and I am able to use the mongo shell from pycharm. but still cannot run programs using pycharm, the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found