Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After migration from bitcore-node-dash: More than one instance of bitcore-lib found #33

Closed
c0deright opened this issue Oct 29, 2018 · 2 comments

Comments

@c0deright
Copy link

c0deright commented Oct 29, 2018

I just migrated from bitcore-node-dash to dashcore-node and am getting this error upon dashcore-node start:

/root/dashcore-node/node_modules/bitcore-lib/index.js:12
    throw new Error(message);
    ^

Error: More than one instance of bitcore-lib found. Please make sure to require bitcore-lib and check that submodules do not also include their own bitcore-lib dependency.
    at Object.bitcore.versionGuard (/root/dashcore-node/node_modules/bitcore-lib/index.js:12:11)
    at Object.<anonymous> (/root/dashcore-node/node_modules/bitcore-lib/index.js:15:9)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/root/dashcore-node/node_modules/insight-api/lib/blocks.js:4:15)

There are no leftover node modules as this was build entirely in Docker (Dockerfile.txt):

#
# build with: docker build . -t mytag -f <Dockerfile>
#
FROM node:carbon-slim

# install dependencies etc in one big RUN statement
RUN apt-get update \
	&& extraPackages=" \
		python \
		libzmq3 \
	" \
	&& buildDepends=" \
		build-essential \
		libzmq3-dev \
	" \
	&& apt-get install -y --no-install-recommends \
		$extraPackages \
		$buildDepends \
	\
	&& npm install -g @dashevo/dashcore-node --unsafe-perm=true\
# they forgot to change the symlink name after forking :)
	&& mv /usr/local/bin/bitcore-node-dash /usr/local/bin/dashcore-node \
	\
	&& cd /root \
	&& dashcore-node create dashcore-node \
	&& perl -pi -e 's#/usr/[^\s]+/scaffold/data/dashd#/usr/local/bin/dashd#' dashcore-node/dashcore-node.json \
	\
	&& cd /root/dashcore-node \
	&& dashcore-node install insight-api \
	\
	&& ln -snf /usr/share/zoneinfo/Europe/Berlin /etc/localtime \
	&& echo 'Europe/Berlin' > /etc/timezone \
	\
# remove not needed files
	&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false $buildDepends \
	&& rm -rf \
		/var/lib/apt/lists/* \
		/root/.npm \
		/root/.node-gyp \
		/usr/local/lib/node_modules/@dashevo/dashcore-node/test \
		/usr/local/lib/node_modules/@dashevo/dashcore-node/benchmarks \
		/usr/local/lib/node_modules/@dashevo/dashcore-node/node_modules/*/test

ENV DASHCORE_OS x86_64-linux-gnu
ENV DASHCORE_VERSION 0.12.3.3
ENV DASHCORE_FILENAME dashcore-${DASHCORE_VERSION}-${DASHCORE_OS}.tar.gz
ENV DASHCORE_SHA256 19191193a8eaf5a10be08eaa3f33ea60c6a2b8848cd8cfeb8aa2046c962b32bd

RUN set -xe \
	&& curl -fSL "https://github.com/dashpay/dash/releases/download/v${DASHCORE_VERSION}/${DASHCORE_FILENAME}" -o /tmp/dashcore.tar.gz \
        && echo "$DASHCORE_SHA256 /tmp/dashcore.tar.gz" | sha256sum -c - \
	&& tar -C /usr/local --strip-components=1 -xzf /tmp/dashcore.tar.gz \
	&& ldconfig \
	&& rm /tmp/dashcore.tar.gz

WORKDIR /root/dashcore-node
EXPOSE 3001

ENV NODE_ENV production

CMD dashcore-node start

Any ideas?

@c0deright
Copy link
Author

c0deright commented Oct 30, 2018

Ok guys ... the solution was:

dashcore-node install @dashevo/insight-api

instead of

dashcore-node install insight-api

facepalm

The documentation is wrong on so many levels:

@Cofresi
Copy link

Cofresi commented Dec 23, 2018

Thanks! Should be fixed now with updated documentation.

@Cofresi Cofresi closed this as completed Dec 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants