./scripts/download: line 44: bitcoin-0.12.1-linux64.tar.gz: Permission denied
I tried to install bitcore via npm, but get this error, anyone know how to fix it??? it is a centos 7
thanks in advance
[root@iZbp14hv8cf5q231f8yzjuZ bitcore]# npm install -g bitcore
[email protected] preinstall /root/.nvm/versions/node/v8.1.2/lib/node_modules/bitcore/node_modules/bitcore-node ./scripts/download
Downloading bitcoin: https://github.com/bitpay/bitcoin/releases/download/v0.12.1-bitcore-4/bitcoin-0.12.1-linux64.tar.gz
./scripts/download: line 44: bitcoin-0.12.1-linux64.tar.gz: Permission denied
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: ./scripts/download
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall 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-06-21T10_49_13_855Z-debug.log
got reason, root user is not allowed
Doesn't work with root and ubuntu user either.
@toponerdong I have tried almost everything. If I don't use root access, then it is giving error Missing write access to /usr/lib/node_modules and if I use sudo then it gives the error as posted above
i face same issue but look like no support is available
Following is how you can work this around (documented below how I fixed it for ubuntu)
- Execute as a ubuntu user (non-root)
- For each directory, change user from root to ubuntu
$ sudo chown ubuntu:staff <directoryName>
Following directories needed changing owner in my case;
- /usr/local/lib/node_modules [and subdirectories]
- /usr/local/bin [for creating shortcuts]
I have encountered this problem。 Just use flowing command:
npm install -g --unsafe-perm=true bitcore
Can't fix...
root@host:~# npm install -g --unsafe-perm=true bitcore
> [email protected] preinstall /root/.nvm/versions/node/v9.3.0/lib/node_modules/bitcore/node_modules/bitcore-node
> ./scripts/download
Downloading bitcoin: https://github.com/bitpay/bitcoin/releases/download/v0.12.1-bitcore-4/
npm ERR! code ELIFECYCLE
npm ERR! errno 22
npm ERR! [email protected] preinstall: `./scripts/download`
npm ERR! Exit status 22
npm ERR!
npm ERR! Failed at the [email protected] preinstall 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/2018-01-08T01_11_58_827Z-debug.log
root@host:~#
@qshuai Thanks it work...
Hi there,
I had to install nvm to manage node versions. so I switched to nvm use v4.6.2 + chown ubuntu:staff -R
- /usr/local/lib/node_modules
- /usr/local/bin
npm install -g --unsafe-perm=true bitcore
and also had to install
apt-get install rpcbind
killed bitcoind and
bitcore start worked :-)
@qshuai it worked
worked too thanks !