Recommended version of Node.js for discovery-cli


I tried to run discovery-cli by running discovery init using Node.js v9.3.0. After that, the following error occurred

(node:9797) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, mkdir 'build/smart_contracts'
    at Object.fs.mkdirSync (fs.js:905:18)
    at createFolders (/usr/local/lib/node_modules/@enigmampc/discovery-cli/src/index.js:103:8)
    at /usr/local/lib/node_modules/@enigmampc/discovery-cli/src/index.js:223:5
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
(node:9797) 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:9797) [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.

When I changed the version of Node.js to probably the latest v12.4.0, the error did not occur.

Therefore, I think that there is a version restriction about Node.js. What is the recommended version of discovery-cli?

I think it is better to specify the recommended version for docs and GitHub README.

Thank you.

Hi @vitocchi,

Thanks for both pointing out a problem and the solution. There is an African proverb that says that “it takes a village to educate a child”, so I would say here that “it takes an online community to develop open source software” :smiley:

From looking around, it seems that the issue that you identified, was solved in Node v10 from this answer on StackOverflow. So I have edited the repo README to specify this requirement, and also bumped the npm package to version 0.0.15 to reflect this change.

Thank you


Thank you for your quick work, @victor !

FYI, the dependency on recursive folder creation has been removed in this PR: and has been included in release v0.0.19 of discovery-cli.

1 Like