Failed at the bitcore-node@3.0.1 preinstall script './scripts/download'

1 GB Memory / 30 GB Disk / SGP1 - Ubuntu 14.04.4 x64
Node v4.4.5

$ wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash
$ command -v nvm
$ nvm install v4
$ apt-get install libzmq3-dev build-essential
$ npm install -g bitcore

What am I doing wrong here?

root@NODE2:~# npm install -g bitcore
\

bitcore-node@3.0.1 preinstall /root/.nvm/versions/node/v4.4.5/lib/node_modules/bitcore/node_modules/bitcore-node
./scripts/download

./scripts/download: line 30: cd: /root/.nvm/versions/node/v4.4.5/lib/node_modules/bitcore/node_modules/bitcore-node/scripts/…/bin: Permission denied
npm ERR! Linux 3.13.0-85-generic
npm ERR! argv “/root/.nvm/versions/node/v4.4.5/bin/node” “/root/.nvm/versions/node/v4.4.5/bin/npm” “install” “-g” "bitcore"
npm ERR! node v4.4.5
npm ERR! npm v2.15.5
npm ERR! code ELIFECYCLE

npm ERR! bitcore-node@3.0.1 preinstall: ./scripts/download
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bitcore-node@3.0.1 preinstall script ‘./scripts/download’.
npm ERR! This is most likely a problem with the bitcore-node package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./scripts/download
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs bitcore-node
npm ERR! Or if that isn’t available, you can get their info via:
npm ERR!
npm ERR! npm owner ls bitcore-node
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! /root/npm-debug.log
root@NODE2:~#
and the debug log…

2001 silly install write writing pseudomap 1.0.2 to /root/.nvm/versions/node/v4.4.5/lib/node_modules/bitcore/node_modules/insight-api/node_modules/lru-cache/node_modules/pseudomap
2002 silly cache afterAdd on-headers@1.0.1
2003 verbose afterAdd /root/.npm/on-headers/1.0.1/package/package.json not in flight; writing
2004 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2005 silly cache afterAdd on-headers@1.0.1
2006 verbose afterAdd /root/.npm/on-headers/1.0.1/package/package.json already in flight; not writing
2007 silly cache afterAdd on-finished@2.3.0
2008 verbose afterAdd /root/.npm/on-finished/2.3.0/package/package.json not in flight; writing
2009 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2010 silly gunzTarPerm extractEntry public/lib/bootstrap/less/type.less
2011 silly gunzTarPerm modified mode [ ‘public/lib/bootstrap/less/type.less’, 436, 420 ]
2012 silly cache afterAdd accepts@1.3.3
2013 verbose afterAdd /root/.npm/accepts/1.3.3/package/package.json not in flight; writing
2014 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2015 silly cache afterAdd depd@1.1.0
2016 verbose afterAdd /root/.npm/depd/1.1.0/package/package.json not in flight; writing
2017 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2018 silly cache afterAdd vary@1.1.0
2019 verbose afterAdd /root/.npm/vary/1.1.0/package/package.json not in flight; writing
2020 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2021 silly cache afterAdd basic-auth@1.0.4
2022 verbose afterAdd /root/.npm/basic-auth/1.0.4/package/package.json not in flight; writing
2023 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2024 silly cache afterAdd bytes@2.3.0
2025 verbose afterAdd /root/.npm/bytes/2.3.0/package/package.json not in flight; writing
2026 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2027 silly cache afterAdd debug@2.2.0
2028 verbose afterAdd /root/.npm/debug/2.2.0/package/package.json not in flight; writing
2029 verbose correctMkdir /root/.npm correctMkdir not in flight; initializing
2030 silly cache afterAdd debug@2.2.0
2031 verbose afterAdd /root/.npm/debug/2.2.0/package/package.json already in flight; not writing
2032 silly addNameRange number 2 { name: ‘compressible’, range: ‘>=2.0.8 <2.1.0’, hasData: true }
2033 silly addNameRange versions [ ‘compressible’,
2033 silly addNameRange [ ‘0.1.0’,
2033 silly addNameRange ‘0.1.1’,
2033 silly addNameRange ‘0.2.0’,
2033 silly addNameRange ‘1.0.0’,
2033 silly addNameRange ‘1.0.1’,
2033 silly addNameRange ‘1.1.0’,
2033 silly addNameRange ‘1.1.1’,

Note: Do not run this command with sudo or with root privileges as this will lead to permission issues.

From: https://bitcore.io/guides/full-node

I’m having the same issue as npm install -g wants to install to /usr/lib/node_modules
I’d have to run it as sudo to have it do a global install. Would it be safe to allow my non-root user write access to /usr/lib/node_modules?

Edit: As an update I’ve moved node to my home directory so it’s writing /home/bitcore/node_modules and the permissions error is gone, however it’s still failing at the download script on preinstall However, upon reviewing the script I see ${tarball_name} is appended to the binary URL and it’s not showing in the output which is strange.

1 Like

Hello, I have exactly teh same problem as described here. I am stuck. I have been trying to figure out the solution from the threads on the forum, but I can not find one. Please assist.