T
T
Taras Serevann2017-06-23 09:24:43
linux
Taras Serevann, 2017-06-23 09:24:43

NPM Access Denied, although I run from sudo. How to fix?

During npm install phantomjs -g:
```
Phantom installation failed { Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1498198903964/phantomjs-2.1 .1-linux-x86_64' -> '/usr/local/lib/node_modules/phantomjs/lib/phantom'
errno: -13,
code: 'EACCES',
syscall: 'link',
path: '/tmp/phantomjs/ phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1498198903964/phantomjs-2.1.1-linux-x86_64',
dest: '/usr/local/lib/node_modules/phantomjs/lib/phantom' } Error: EACCES: permission denied, link '/tmp/phantomjs/phantomjs-2.1.1-linux-x86_64.tar.bz2-extract-1498198903964/phantomjs-2.1.1-linux-x86_64' -> '/usr/local/lib/ node_modules/phantomjs/lib/phantom'
```
In this case, the whoami command gives the output:
```
root
```
i.e. there should be no problems with rights. How to decide?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
podvzbzdnul, 2017-06-23
@Taras_Serevann

npm config set unsafe-perm=true

N
Nikita Kit, 2017-06-23
@ShadowOfCasper

Try sudo erm -Rf /tmp , then sudo npm cache clear and reinstall

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question