bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

git dep preparation failed during installation

Open ghost opened this issue 3 years ago • 2 comments

npm install doesn't work due to a bad dependency on gulp's git version.

~/Code/bitcore $ docker run -it node /bin/bash
root@7e9476fbe733:/# git clone https://github.com/bitpay/bitcore.git
Cloning into 'bitcore'...
remote: Enumerating objects: 94915, done.
remote: Counting objects: 100% (690/690), done.
remote: Compressing objects: 100% (363/363), done.
remote: Total 94915 (delta 408), reused 483 (delta 322), pack-reused 94225
Receiving objects: 100% (94915/94915), 89.10 MiB | 2.09 MiB/s, done.
Resolving deltas: 100% (65847/65847), done.
root@7e9476fbe733:/# cd bitcore/
root@7e9476fbe733:/bitcore# npm install

> postinstall
> npm run bootstrap && npm run compile


> bootstrap
> ./node_modules/.bin/lerna bootstrap

lerna notice cli v3.22.1
lerna info Bootstrapping 16 packages
lerna info Installing external dependencies
lerna ERR! npm install exited 128 in 'bitcore-node'
lerna ERR! npm install stderr:
npm ERR! code 128
npm ERR! git dep preparation failed
npm ERR! command /usr/local/bin/node /usr/local/lib/node_modules/npm/bin/npm-cli.js install --force --cache=/root/.npm --prefer-offline=false --prefer-online=false --offline=false --no-progress --no-save --no-audit
npm ERR! npm WARN using --force Recommended protections disabled.
npm ERR! npm ERR! code 128
npm ERR! npm ERR! command failed
npm ERR! npm ERR! command git --no-replace-objects ls-remote ssh://[email protected]/gulpjs/gulp.git
npm ERR! npm ERR! [email protected]: Permission denied (publickey).
npm ERR! npm ERR! fatal: Could not read from remote repository.
npm ERR! npm ERR!
npm ERR! npm ERR! Please make sure you have the correct access rights
npm ERR! npm ERR! and the repository exists.
npm ERR!
npm ERR! npm ERR! A complete log of this run can be found in:
npm ERR! npm ERR!     /root/.npm/_logs/2021-06-03T10_15_16_658Z-debug.log

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-06-03T10_15_27_722Z-debug.log

lerna ERR! npm install exited 128 in 'bitcore-node'
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
npm notice
npm notice New minor version of npm available! 7.13.0 -> 7.15.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.15.1
npm notice Run npm install -g [email protected] to update!
npm notice
npm notice
npm notice New minor version of npm available! 7.13.0 -> 7.15.1
npm notice Changelog: https://github.com/npm/cli/releases/tag/v7.15.1
npm notice Run npm install -g [email protected] to update!
npm notice
npm ERR! code 128
npm ERR! path /bitcore
npm ERR! command failed
npm ERR! command sh -c npm run bootstrap && npm run compile

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-06-03T10_15_27_930Z-debug.log

If you do have an SSH key registered with GitHub set up, it has the error

npm ERR! npm ERR! command git --no-replace-objects clone --mirror -q ssh://[email protected]/gulpjs/gulp.git /Users/lola/.npm/_cacache/tmp/git-clone-9ac5eff0/.git
npm ERR! npm ERR! fatal: destination path '/Users/sproxet/.npm/_cacache/tmp/git-clone-9ac5eff0/.git' already exists and is not an empty directory.

ghost avatar Jun 03 '21 10:06 ghost

This was a pain in the ass to solve - but here is what finally worked:

node version: 15.0.0 npm version: 6.14.15

nvm install v15.0.0

This will install the 15.0.0 node, but the 7.0.2 npm version - but npm needs to be downgraded to 6.14.15

npm i -g [email protected]

If you use a lower node version then <15.0.0, there are compilation issues with V8 engine. If you use the higher npm version, there is the git directory already exists error - so the magic combination is the 15.0.0 node version, and 6.14.15 npm version.

Also - not sure if it's required - but I installed the git SSH keys - and separately installed gulp

npm install gulpjs/gulp-cli -g npm install gulp -g --save-dev

Other env elements that maybe needed - but not certain:

sudo apt install build-essential sudo apt install git curl wget vim golang python -y

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb sudo apt install ./google-chrome-stable_current_amd64.deb

vadpert avatar Sep 24 '21 18:09 vadpert

Addendum to above:

The node 15.0.0 version fails to start with error message of "Error: Cannot find module './build/Debug/addon' for the heapdump package.

What seems to work is to downgrade - everything to node v8.16.0 and npm 6.4.1 -- and do a full cleanup - delete bitcore and redownload from git - https://github.com/bitpay/bitcore/issues/2603

vadpert avatar Sep 25 '21 20:09 vadpert