Can't install bitcore

The README on GitHub tells me to do
npm install bitcore
but when I run that I get errors.
Can I download the built JS library (both minified and clear) somewhere so I don’t have to build it myself?

$ npm install bitcore
npm http GET
npm http 200
npm http GET
npm http 200
npm http GET
npm http GET
npm http GET
npm http GET
npm http GET
npm http GET
npm http GET
npm http 200
npm ERR! error installing bitcore@0.10.3
npm http 200

npm ERR! Error: No compatible version found: inherits@'inherits@2.0.1'
npm ERR! Valid install targets:
npm ERR! ["1.0.0","2.0.0","2.0.1"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR!     at /usr/share/npm/lib/cache.js:375:15
npm ERR!     at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR!     at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR!     <>
npm ERR! or use
npm ERR!     reportbug --attach /home/dskloet/bitcore/npm-debug.log npm
npm ERR! 
npm ERR! System Linux 3.13.0-44-generic
npm ERR! command "node" "/usr/bin/npm" "install" "bitcore"
npm ERR! cwd /home/dskloet/bitcore
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: inherits@'inherits@2.0.1'
npm ERR! message Valid install targets:
npm ERR! message ["1.0.0","2.0.0","2.0.1"]
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/dskloet/bitcore/npm-debug.log
npm not ok

It looks like the inherits dependency isn’t available with node v0.6.12 and npm v1.1.4, upgrading those should fix it.

Anything greater than node 0.10 should work. I did a test with node 0.6.12 and was unable to install because of separate similar issues.

I’ve tried installing node before but always failed. I wasn’t aware of having any version of node installed. Isn’t the point of a package manager that it takes care of installing all the necessary dependencies? Maybe bitcore needs to declare its dependency on node v1.1.4?

OK, I followed the steps from here:
And I think it’s installed now.

So now it’s installed but I still can’t build. I installed gulp
$ sudo npm install --global gulp
but when I do gulp browser I get gulp: command not found

I wish there was some tutorial that doesn’t assume all kinds of things pre-installed.

Btw, I’m on Ubuntu 12.04 LTS.

Can you install other packages globally such as istanbul, mocha or browserify?

I discovered there is a symlink /usr/bin/gulp -> …/lib/node_modules/gulp/bin/gulp.js
But this directory is only readable for root. Why would npm make a globally installed package only readable for root?

I also found that some files in ~/.npm were only readable by root. This npm thing seems really broken. I’ve moved my .npm directory away and did

$ npm install gulp

(not as root this time) again.

Now when I run gulp browser I get Error: Cannot find module 'bitcore-build'.

You need to run “npm install” to download dependencies defined in “package.json”. This should create a “node_modules” directory, with “bitcore-build” and others.

You mean npm install without arguments? Do I have to do this in a specific directory?
I already have a node_modules directory with bitcore directory inside it.

Yep, within the bitcore directory. This will install the additional development dependencies.

Edit: This is usually done after git cloning the bitcore repository (rather than using npm install bitcore).

It worked! Thanks.

(And some filler because the post most be at least 20 characters. :-/)