Error during Discovery Init

Seeing this when calling discovery init, working throught the millionaires problem.

Set up the Discovery Enigma Protocol development environment in the current folder? (Y/n) Y
Checking if “docker” is installed in the system… FOUND
Checking if “docker-compose” is installed in the system… FOUND
Checking if “rustc” is installed in the system… FOUND
Checking if “cargo” is installed in the system… FOUND
Checking if “rustup” is installed in the system… FOUND
Checking if “npm” is installed in the system… FOUND
Checking if “git” is installed in the system… FOUND
Installing Rust nightly-2019-05-20…
info: syncing channel updates for ‘nightly-2019-05-20-x86_64-unknown-linux-gnu’
info: latest update on 2019-05-20, rust version 1.36.0-nightly (6afcb5628 2019-05-19)
info: downloading component ‘rustc’
info: downloading component ‘rust-std’
info: downloading component ‘cargo’
info: downloading component ‘rust-docs’
info: installing component ‘rustc’
info: installing component ‘rust-std’
info: installing component ‘cargo’
info: installing component ‘rust-docs’

nightly-2019-05-20-x86_64-unknown-linux-gnu installed - rustc 1.36.0-nightly (6afcb5628 2019-05-19)

info: checking for self-updates
Checking for Rust wasm32-unknown-unknown…
info: downloading component ‘rust-std’ for ‘wasm32-unknown-unknown’
info: installing component ‘rust-std’ for ‘wasm32-unknown-unknown’
(node:62) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, mkdir ‘build/smart_contracts’
at Object.fs.mkdirSync (fs.js:885:18)
at createFolders (/usr/lib/node_modules/@enigmampc/discovery-cli/src/index.js:103:8)
at /usr/lib/node_modules/@enigmampc/discovery-cli/src/index.js:223:5
at
at process._tickDomainCallback (internal/process/next_tick.js:229:7)
(node:62) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:62) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
gavin@DESKTOP-49GSI99:/c/users/GavinStevens/source/rust_projects/millionaires_problem$

What version of Node are you using?
You can find out by running node -v

v8.12.0 it says when i run node -v

You need Node version 10 or higher as stated in the Requirements section of the README. We rely on a feature that was introduced in version 10, hence this requirement.

Ok, my bad… Let me try to upgrade it.

1 Like

Hmm, still having problems…

Node: v10.16.0
docker-compose version 1.24.0, build 0aa5906
rustup 1.18.3 (435397f48 2019-05-22)

gavin@DESKTOP-49GSI99:~/projects/rust_million_problem$ 
discovery init
internal/modules/cjs/loader.js:805
  return process.dlopen(module, path.toNamespacedPath(filename));
             ^

Error: The module 
'/usr/lib/node_modules/@enigmampc/discovery- 
cli/node_modules/scrypt/build/Release/scrypt.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 64. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at Object.Module._extensions..node (internal/modules/cjs/loader.js:805:18)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/usr/lib/node_modules/@enigmampc/discovery-cli/node_modules/scrypt/index.js:3:20)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)

Yes, this is because you first installed discovery-cli with one version of Node (8.12.0), and compiled some of the dependencies against that version of Node, and you then later upgraded Node to 10.16.0, so it complains that the versions mismatch (the current version of Node vs. the version of Node used to install discovery-cli).

The solution is easy: uninstall and reinstall:
npm uninstall -g @enigmampc/discovery-cli
npm install -g @enigmampc/discovery-cli

and the issue you are facing should go away :slight_smile:

Victor

I had the problem when I ran with 10.13.0. v10.16.0 works.