Build Error: OpenZeppelin SDK 2.6 | Node v13.1.0

Is the current version of oz SDK compatible and supported in Node v13.1.0

I am getting installation errors

Command:
npx npm install @openzeppelin/cli@2.6

Error:

npm WARN deprecated truffle-config@1.1.16: WARNING: This package has been renamed to @truffle/config.
npm WARN deprecated truffle-provider@0.1.16: WARNING: This package has been renamed to @truffle/provider.
npm WARN deprecated truffle-error@0.0.5: WARNING: This package has been renamed to @truffle/error.
npm WARN deprecated truffle-interface-adapter@0.2.5: WARNING: This package has been renamed to @truffle/interface-adapter.

> sha3@1.2.3 install /Users/pk/Documents/code/node_modules/sha3
> node-gyp rebuild

  CXX(target) Release/obj.target/sha3/src/addon.o
In file included from ../src/addon.cpp:9:
In file included from ../src/KeccakNISTInterface.h:17:
../src/KeccakSponge.h:23:9: warning: 'ALIGN' macro redefined [-Wmacro-redefined]
#define ALIGN __attribute__ ((aligned(32)))
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/i386/param.h:83:9: note:
      previous definition is here
#define ALIGN(p)        __DARWIN_ALIGN(p)
        ^
../src/addon.cpp:83:11: error: no matching member function for call to 'Set'
                target->Set(className, f);
                ~~~~~~~~^~~
/Users/pk/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3424:37: note: candidate function not viable: requires 3 arguments, but
      2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                    ^
/Users/pk/Library/Caches/node-gyp/13.1.0/include/node/v8.h:3427:37: note: candidate function not viable: requires 3 arguments, but
      2 were provided
  V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context, uint32_t index,
                                    ^
1 warning and 1 error generated.
make: *** [Release/obj.target/sha3/src/addon.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/pk/.nvm/versions/node/v13.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/Users/pk/.nvm/versions/node/v13.1.0/bin/node" "/Users/pk/.nvm/versions/node/v13.1.0/lib/node_modules/npm/node_modules/npm-lifecycle/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/pk/Documents/code/node_modules/sha3
gyp ERR! node -v v13.1.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN ajv-keywords@3.2.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN recompose@0.27.1 requires a peer of react@^0.14.0 || ^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rimble-ui@0.1.1 requires a peer of react@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN rimble-ui@0.1.1 requires a peer of react-dom@^15.0.0 || ^16.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN styled-components@4.0.3 requires a peer of react@>= 16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN styled-components@4.0.3 requires a peer of react-dom@>= 16.3.0 but none is installed. You must install peer dependencies yourself.
npm WARN dcl-project@1.0.0 No repository field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3@1.2.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/pk/.npm/_logs/2019-11-21T06_13_06_225Z-debug.log
1 Like

Hi @pkr,

To install locally in a project you can use:
npm install @openzeppelin/cli
You can then run using
npx oz [command]

This looks like an issue with node 13. I get the same error with sha3.
I have created an issue: https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1289
It appears to be caused by the version of sha3 which is a dependency of web3.


I use node v10.16.0, though you should be able to use node 12. I suggest changing the version of node to either 10 or 12.

$ nvm install 10.16.0
$ nvm alias default 10.16.0
1 Like

Thank you @abcoathup for the quick turnaround.

I will try this tonight after dinner and let you know how it goes.

1 Like

Happy Friday @abcoathup

managed to get it further w/ Node 10.16.2

for this command npx oz create i am getting the following error

Error

Cannot find module 'dotenv'

trying to figure out what am i missing here? it used to work alright before?!

1 Like

figured it out @abcoathup

had to install the following

npm install dotenv
npm install truffle-hdwallet-provider
1 Like

Hi @pkr,

I assume your network setup includes using dotenv and truffle-hdwallet-provider similar to the setup in https://docs.openzeppelin.com/sdk/2.6/public-deploy

truffle-hdwallet-provider is deprecated (https://www.npmjs.com/package/truffle-hdwallet-provider) we should now use @truffle/hdwallet-provider.

Hi @pkr,

I wanted to let you know that OpenZeppelin CLI 2.7.1 runs on node 13.

See the announcement of OpenZeppelin CLI 2.7 for details on new functionality.