Installation permission problems
See original GitHub issueWhen I tried to install via npm, both installation and uninstall fails with permission errors. Even though I’m the root, script is not able to run as su. Trying with sudo also fails. Deleting current .mongorc.js file does not solve the problem.
> mongo-hacker@0.0.12 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/verbose.js hacks/api.js hacks/index_paranoia.js hacks/sh_status.js hacks/count.js > mongo_hacker.js
INSTALLATION
Linking MongoHacker to .mongorc.js in your home directory:
ln -sf "/usr/lib/node_modules/mongo-hacker/mongo_hacker.js" ~/.mongorc.js
ln: failed to access ‘/root/.mongorc.js’: Permission denied
Makefile:13: recipe for target 'install' failed
make: *** [install] Error 1
npm ERR! Linux 4.2.0-16-generic
npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "mongo-hacker"
npm ERR! node v4.3.1
npm ERR! npm v2.14.12
npm ERR! code ELIFECYCLE
npm ERR! mongo-hacker@0.0.12 install: `make install`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the mongo-hacker@0.0.12 install script 'make install'.
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 install
npm ERR! You can get their info via:
npm ERR! npm owner ls mongo-hacker
npm ERR! There is likely additional logging output above.
> mongo-hacker@0.0.12 postuninstall /usr/lib/node_modules/mongo-hacker
> make uninstall
rm -f ~/.mongorc.js
rm: cannot remove ‘/root/.mongorc.js’: Permission denied
Makefile:27: recipe for target 'uninstall' failed
make: *** [uninstall] Error 1
npm WARN continuing anyway mongo-hacker@0.0.12 postuninstall: `make uninstall`
npm WARN continuing anyway Exit status 2
npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log
Issue Analytics
- State:
- Created 8 years ago
- Comments:12
Top Results From Across the Web
Error 5, Access is Denied while installing software on ...
Fix Error 5, Access is Denied message when you try to install software on Windows 11/10 computer. You need to change permissions, etc....
Read more >Permission issues when installing applications or games, after
I have been having permission issues when installing applications or games -even when running with elevated privileges that would mitigate ...
Read more >Software Installation Failure - Access denied to Deploy Software
If you have used 'Run As' option while installing the software, ensure that the user has necessary privileges to access the path, to...
Read more >Install Error: Permission to Install Was Denied - Veriato
Insufficient permissions or User Account Control (UAC) on a Windows device prevented remote installation. This could be a problem attempting deployment on a ......
Read more >Big Sur Problem?: "You do not have… - Apple Developer
don't have permission to open the App, contact Your computer or network Administrator for assistance" Also it happens when I want to install...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Apparently scripts are expected to be run as user
nobodyif npm is run asroot. Thenobodyuser doesn’t seem to have write access to the target directory, hence the error.A solution is to run npm as a regular user, but with write access to the install directory:
Editted to fix permissions afterward.
Note that it’s a pretty crappy hacky workaround, far from ideal from a security viewpoint. It shouldn’t be required, and is not a real solution to this issue.
Same here