[SOLVED] Bitcore Service Tutorial


(Wmpedersen) #1

I’m trying to run a service using the lemonade-stand tutorial using only the sample code but it fails to require bitcore-lib properly.

$ bitcore create -d ~/.bitcoin mynode
$ mkdir -p myservice
$ cd !$
$ npm init
$ nano index.js (tutorial code)
$ cd ~/mynode/node_modules
$ ln -s ~/myservice
$ cd ~/mynode
$ bitcore add myservice

bitcore-node wasn’t available on my system with a fresh install of bitcore, so I use bitcore add. Was this incorrect? when I try to run my node after adding the service bitcore complains that my service can’t find bitcore-lib. Installing bitcore-lib into my service says that there are two different bitcore-libs and it can’t decide which to use. Is it some error with the symlink? I don’t see a node_modules folder under the service but I figured it would try to use bitcore-lib from the node’s configuration?

EDIT: I managed to solve this by using absolute paths in my service to my node’s node_modules folder.