Permission problem installing bitcore I have tried to install bitcore.io on a clean and upgraded Ubuntu 16.04.3 (64 bits) but always get permission errors.

I have already created a user and password for bitcore:

sudo useradd -r -m bitcore
sudo usermod -aG sudo,adm bitcore
sudo passwd bitcore


Installed nodejs v8.9.3 and ZeroMQ:

apt-get install libzmq3-dev build-essential


But when install bitcore:

npm install -g bitcore


I got this error message after download bitcoin-0.12.1-linux64.tar.gz:

bitcoin-0.12.1/lib/libbitcoinconsensus.so.0.0.0
npm ERR! path ../lib/node_modules/bitcore/bin/bitcore
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall symlink
npm ERR! Error: EACCES: permission denied, symlink '../lib/node_modules/bitcore/bin/bitcore' -&gt; '/usr/bin/bitcore'
npm ERR!  { Error: EACCES: permission denied, symlink '../lib/node_modules/bitcore/bin/bitcore' -&gt; '/usr/bin/bitcore'
npm ERR!   cause: 
npm ERR!    { Error: EACCES: permission denied, symlink '../lib/node_modules/bitcore/bin/bitcore' -&gt; '/usr/bin/bitcore'
npm ERR!      errno: -13,
npm ERR!      code: 'EACCES',
npm ERR!      syscall: 'symlink',
npm ERR!      path: '../lib/node_modules/bitcore/bin/bitcore',
npm ERR!      dest: '/usr/bin/bitcore' },
npm ERR!   stack: 'Error: EACCES: permission denied, symlink \'../lib/node_modules/bitcore/bin/bitcore\' -&gt; \'/usr/bin/bitcore\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'symlink',
npm ERR!   path: '../lib/node_modules/bitcore/bin/bitcore',
npm ERR!   dest: '/usr/bin/bitcore' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.


Also, I have ran the previous command with sudo but the error is the same.

Also, I have ran npm install bitcore and it is installed without problem but cannot run bitcored. System returns bitcored: command not found.
I solved this problem using NodeJS v4. I did a clean install again and ran these commands:

NOTE: My user is 'test' so my home is located at /home/test. Replace 'test' with your current user.


Install NVM:

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh |  bash


After that, close and reopen your terminal and test whether NVM was correctly installed:

$ nvm --version

Install NodeJS v4:

$ nvm install v4


Check whether NodeJS was correctly instaled:

$ node -v

Install ZeroMQ and Tools:

$ sudo apt-get install -y libzmq3-dev build-essential

Install Bitcore. Today (December 2017), the lastest version is 4.1.1. This version uses two different versions of bitcore-lib and cause a conflict when you run bitcored. So, install bitcore v4.1.0:

$ npm install -g bitcore@4.1.0

Done!! 


With these steps, I could use bitcore however they doesn't solve my original problem which is, install bitcore using NodeJS v8.9.3.