Error when Installing

I’m exactly using the command npm install -g @enigmampc/discovery-cli to install it.
Here’s some of the output:

> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/lang.js'
> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/fp/last.js'
> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/last.js'
> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/fp/lastIndexOf.js'
> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/lastIndexOf.js'
> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/fp/lastIndexOfFrom.js'
> npm WARN tar ENOENT: no such file or directory, open '/root/.nvm/versions/node/v11.15.0/lib/node_modules/.staging/lodash-47f770d0/lodash.js'
> npm WARN @truffle/decoder@3.0.15 requires a peer of truffle@^5.0.14 but none is installed. You must install peer dependencies yourself.
> npm WARN acorn-jsx@5.1.0 requires a peer of acorn@^6.0.0 || ^7.0.0 but none is installed. You must install peer dependencies yourself.
> npm ERR! Error while executing:
> npm ERR! /usr/bin/git ls-remote -h -t
> npm ERR! 
> npm ERR! fatal: cannot come back to cwd: Permission denied
> npm ERR! 
> npm ERR! exited with error code: 128
> npm ERR! A complete log of this run can be found in:
> npm ERR!     /root/.npm/_logs/2019-11-07T13_03_06_844Z-debug.log

Actually there are tens of rows indicating the “no such file or directory” error. Even adding the parameters --unsafe-perm or --allow-root doesn’t work.
I’m using node v11.15 with nvm and npm v6.13.0 on Ubuntu 18.04. And i also have tried node v8 LTS and v10 LTS.

1 Like

Hi. It seems your user doesn’t have permission to install packages globally.

This thread has more info.

Quick answer is to use nvm, though there are other options. Hope that helps, let us know how it goes.

ps-- welcome back @ycfung ! We would love to hear what you’re thinking of building.

Thank you, I’ve been using nvm to manage node. I only have root user on my server, so I don’t think it’s something related to permissions. btw, can I know what Linux distribution are u guys using to deploy the discovery-CPI?

1 Like

Hi @ycfung I’m having the same issue that you’re having when I installed discovery-cli 0.1.4. Prior to that I was using 0.1.3 and didn’t have a problem.

I’m not using nvm though - I was going to try that next since it’s recommended but since you’re still having the issue I’ll hold off.

@ycfung we are using Ubuntu, either 16 or 18

Hi @laura and @victor I have a clean installation using Ubuntu 18.04 and node v11.5 with nvm. So far I have successfully deployed the millionaire problem secret contract. I just tried a few times and do some snapshot step by step on a virtual machine, then, it worked. :slight_smile: And I will go on testing it.


Does this work on a Mac at all? Wanted to do something with this at ETH Waterloo, but couldn’t install it.

I’m using Mac Mohave 10.14.6. Node v13.1.0. Just doing regular “npm i @enigmampc/discovery-cli” (after npm init, local node_modules), and just getting tons of dependency errors. There are no binaries for my system (e.g., fsevents), so it tries building from source, and then that fails because of version incompatibilities.

Sample errors:
npm run rebuild || echo “Keccak bindings compilation fail. Pure JS implementation will be used.”
Followed by C++ compile errors like:
…/src/ error: too few arguments to function call, single argument ‘context’ was not specified
KeccakWrapper* to = Nan::ObjectWrap::Unwrap(info[0]->ToObject());

gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! errno 1

Failed at the sha3@1.2.3 install script

I’ve tried lots of things, like manually installing all the things that error out, but everything has dependency issues.

Is there some configuration that will make this work on Mac Mohave, or do I need to abandon this and try to use VMs? I really prefer to run things locally if possible.

Hi there, yes I use Mac OS, exactly your version too.

Its likely your node version isn’t yet supported, I use nvm to toggle versions and I’m currently running discovery-cli on 10.17.0 and 11.15.0, I’ve used some others too.

From the installation page, " The current discovery-cli version works with node releases 8.0 to 11.15."

Sorry you didn’t get going at Waterloo, wish you’d said something then.
Anyway you’re here now, happy coding, please let us know how it goes.

Thanks, taariq! I was coming to that conclusion too – somehow missed that line in the docs!

It would have been quite a stretch at Waterloo - it was peripheral to the idea (options DEX), but I was looking for a way to securely/privately call into exchange APIs. Would like to explore that more when I’m not under pressure. Let me downgrade Node and get a little farther first. Thanks again!


Hey @endymionjkb just checking in to make sure we resolved this for you – let us know if you have any more problems!

Thanks for checking in, @ainsley! I got a bit farther, at least before holidays and travel intervened. Using nvm, I installed 11.15 (nvm install 11.15; nvm use 11.15). Then I deleted node_modules and package-lock.json, did “npm init” again to start fresh, and tried “npm i @enigmapc/discovery-cli” again. This did appear to work - no errors (plenty of warnings), and it looks like it’s there.

It wouldn’t let me install it globally, though, so it’s just local. So now I’m not sure how to run “discovery init” when it’s installed locally. “discovery” isn’t in the path now, and I’m not sure what it is. I’m probably close.

From package-lock.json:
@enigmampc/discovery-cli”: {
“version”: “0.1.8”,
“resolved”: “”,
“integrity”: “sha512-j55nRzzxxkd6tT9gCTIFHXOrLwdHWTVbCprR5ORN7VehMUdwSlwuPP8y/fF+YquirmE5jOiM9Lvgrzbwj7ZYaQ==”,
“requires”: {
@truffle/workflow-compile”: “^2.1.13”,
“axios”: “^0.19.0”,
“braces”: “>=2.3.1”,
“chalk”: “^3.0.0”,
“clui”: “^0.3.6”,
“concat-stream”: “>=1.5.2”,
“docker-compose”: “^0.22.2”,
“dotenv”: “^8.2.0”,
“enigma-js”: “^0.3.0”,
“get-cursor-position”: “^1.0.5”,
“hasbin”: “^1.2.3”,
“inquirer”: “^7.0.0”,
“lodash.template”: “>=4.5.0”,
“node-docker-api”: “^1.1.22”,
“simple-git”: “^1.126.0”,
“truffle”: “^5.1.2”,
“web3”: “1.2.4”,
“yargs”: “^15.0.2”

Do you recall why not?
You may have to try again and we can work through that.

Permission errors unless I use sudo (which I don’t really want to do because I could mess up other projects). When I use sudo, then I run into the issue of node versions again (global node is v13, vs the v11 I need for this). Shouldn’t it also work locally? Or can I somehow call it using a path? What is discovery anyway, a C++ executable? Can I just use the binary somehow?

No, discovery-cli isn’t an executable, its a javascript package and it needs to be installed globally, but you can and should run it without sudo.

Its recommend you use nvm to install a supported node version and install it globally there.

Please also see the detailed installation instructions