Hi @MWaser,
I’m sorry that you still had an issue when using WSL2.
I changed to node 12 and just unpacked the tutorial using @openzeppelin/cli unpack tutorial
and get the same error as you, though my understanding is that it then uses a pure JS implementation of the dependency. I logged today that this error is displayed when installing the CLI:
https://github.com/OpenZeppelin/openzeppelin-sdk/issues/1371#issuecomment-582701916
Once the tutorial is unpacked, we can initialize our project with OpenZeppelin
$ npx oz init app
Create the contract on our local testnet (after running ganache-cli -d
in a separate terminal)
$ npx oz create
Nothing to compile, all contracts are up to date.
? Pick a contract to instantiate Counter
? Pick a network development
✓ Added contract Counter
✓ Contract Counter deployed
All contracts have been deployed
? Call a function to initialize the instance after creating it? Yes
? Select which function * initialize(num: uint256)
? num (uint256): 23
✓ Setting everything up to create contract instances
✓ Instance created at 0xCfEB869F69431e42cdB54A4F4f105C19C080A601
0xCfEB869F69431e42cdB54A4F4f105C19C080A601
Start the client
$ cd client
$ npm run start
View the Counter dapp in the browser http://localhost:3000/counter
Alternatively, I generally use node 10.
This was the error I was shown when unpacking the tutorial:
$ npx @openzeppelin/cli unpack tutorial
../src/privatekey.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE privateKeyNegate(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/privatekey.cc:73:30: warning: ignoring return value of ‘int secp256k1_ec_privkey_negate(const secp256k1_context*, unsigned char*)’, declared with attribute warn_unused_result [-Wunused-result]
secp256k1_ec_privkey_negate(secp256k1ctx, &private_key[0]);
~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/ecdsa.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE sign(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/ecdsa.cc:88:131: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
fo.GetIsolate()->GetCurrentContext(), Nan::New<v8::String>("signature").ToLocalChecked(), COPY_BUFFER(&output[0], 64));
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/ecdsa.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:3408:37: note: declared here
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^~~
../src/ecdsa.cc:89:130: warning: ignoring return value of ‘v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)’, declared with attribute warn_unused_result [-Wunused-result]
nfo.GetIsolate()->GetCurrentContext(), Nan::New<v8::String>("recovery").ToLocalChecked(), Nan::New<v8::Number>(recid));
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/ecdsa.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:3408:37: note: declared here
V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
^~~
../src/addon.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE KeccakWrapper::Initialize(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/addon.cc:37:47: error: no matching function for call to ‘v8::Value::IntegerValue()’
unsigned int rate = info[0]->IntegerValue();
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/addon.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^~~~~~~~~~~~
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
../src/addon.cc:38:51: error: no matching function for call to ‘v8::Value::IntegerValue()’
unsigned int capacity = info[1]->IntegerValue();
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/addon.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^~~~~~~~~~~~
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
../src/addon.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE KeccakWrapper::AbsorbLastFewBits(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/addon.cc:56:48: error: no matching function for call to ‘v8::Value::IntegerValue()’
unsigned char bits = info[0]->IntegerValue();
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/addon.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^~~~~~~~~~~~
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
../src/addon.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE KeccakWrapper::Squeeze(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/addon.cc:64:43: error: no matching function for call to ‘v8::Value::IntegerValue()’
size_t length = info[0]->IntegerValue();
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/addon.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate: v8::Maybe<long int> v8::Value::IntegerValue(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
^~~~~~~~~~~~
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2609:40: note: candidate expects 1 argument, 0 provided
../src/addon.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE KeccakWrapper::Copy(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/addon.cc:75:82: error: no matching function for call to ‘v8::Value::ToObject()’
KeccakWrapper* to = Nan::ObjectWrap::Unwrap<KeccakWrapper>(info[0]->ToObject());
^
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
from ../src/addon.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2576:44: note: candidate: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
^~~~~~~~
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2576:44: note: candidate expects 1 argument, 0 provided
In file included from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14:0,
from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:25,
from /home/abcoathup/.cache/node-gyp/12.14.1/include/node/node.h:63,
from ../src/addon.cc:1:
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2590:31: note: candidate: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
Local<Object> ToObject(Isolate* isolate) const);
^
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8.h:2590:31: note: candidate expects 1 argument, 0 provided
Local<Object> ToObject(Isolate* isolate) const);
^
/home/abcoathup/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
declarator __attribute__((deprecated(message)))
^~~~~~~~~~
make: *** [Release/obj.target/keccak/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 (/home/abcoathup/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:223:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 4.4.0-18362-Microsoft
gyp ERR! command "/home/abcoathup/.nvm/versions/node/v12.14.1/bin/node" "/home/abcoathup/.nvm/versions/node/v12.14.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/abcoathup/.npm/_npx/3973/lib/node_modules/@openzeppelin/cli/node_modules/solc-wrapper/node_modules/keccak
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! keccak@1.4.0 rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the keccak@1.4.0 rebuild 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! /home/abcoathup/.npm/_logs/2020-02-06T04_03_19_762Z-debug.log
✓ Kit downloaded and unpacked
The kit is ready to use.
Quick Start
Run your local blockchain:
> ganache-cli --deterministic
Initialize the OpenZeppelin SDK project:
> openzeppelin init app
Go to the client directory:
> cd client
Run the React app:
> npm run start
Continue in your browser!
More at https://github.com/OpenZeppelin/starter-kit-tutorial