Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: npm install #171

Closed
wants to merge 4 commits into from
Closed

fix: npm install #171

wants to merge 4 commits into from

Conversation

leovct
Copy link

@leovct leovct commented Nov 22, 2023

Description

When trying to install the dependencies, it fails.

$ node --version
v12.22.12

$ npm --version
6.14.16

$ npm install
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!

> [email protected] preinstall /Users/leovct/Documents/work/clients/pos-portal/node_modules/scrypt
> node node-scrypt-preinstall.js


> [email protected] install /Users/leovct/Documents/work/clients/pos-portal/node_modules/ganache-cli/node_modules/keccak
> npm run rebuild || echo "Keccak bindings compilation fail. Pure JS implementation will be used."


> [email protected] rebuild /Users/leovct/Documents/work/clients/pos-portal/node_modules/ganache-cli/node_modules/keccak
> node-gyp rebuild

  CXX(target) Release/obj.target/keccak/src/addon.o
../src/addon.cc:37:47: error: too few arguments to function call, single argument 'context' was not specified
    unsigned int rate = info[0]->IntegerValue();
                        ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/leovct/Library/Caches/node-gyp/12.22.12/include/node/v8.h:2705:40: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
                                       ^
../src/addon.cc:37:18: error: no viable conversion from 'Maybe<int64_t>' (aka 'Maybe<long long>') to 'unsigned int'
    unsigned int rate = info[0]->IntegerValue();
                 ^      ~~~~~~~~~~~~~~~~~~~~~~~
../src/addon.cc:38:51: error: too few arguments to function call, single argument 'context' was not specified
    unsigned int capacity = info[1]->IntegerValue();
                            ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/leovct/Library/Caches/node-gyp/12.22.12/include/node/v8.h:2705:40: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
                                       ^
../src/addon.cc:38:18: error: no viable conversion from 'Maybe<int64_t>' (aka 'Maybe<long long>') to 'unsigned int'
    unsigned int capacity = info[1]->IntegerValue();
                 ^          ~~~~~~~~~~~~~~~~~~~~~~~
../src/addon.cc:56:48: error: too few arguments to function call, single argument 'context' was not specified
    unsigned char bits = info[0]->IntegerValue();
                         ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/leovct/Library/Caches/node-gyp/12.22.12/include/node/v8.h:2705:40: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
                                       ^
../src/addon.cc:56:19: error: no viable conversion from 'Maybe<int64_t>' (aka 'Maybe<long long>') to 'unsigned char'
    unsigned char bits = info[0]->IntegerValue();
                  ^      ~~~~~~~~~~~~~~~~~~~~~~~
../src/addon.cc:64:43: error: too few arguments to function call, single argument 'context' was not specified
    size_t length = info[0]->IntegerValue();
                    ~~~~~~~~~~~~~~~~~~~~~ ^
/Users/leovct/Library/Caches/node-gyp/12.22.12/include/node/v8.h:2705:40: note: 'IntegerValue' declared here
  V8_WARN_UNUSED_RESULT Maybe<int64_t> IntegerValue(
                                       ^
../src/addon.cc:64:12: error: no viable conversion from 'Maybe<int64_t>' (aka 'Maybe<long long>') to 'size_t' (aka 'unsigned long')
    size_t length = info[0]->IntegerValue();
           ^        ~~~~~~~~~~~~~~~~~~~~~~~
../src/addon.cc:75:73: error: no matching member function for call to 'ToObject'
    KeccakWrapper* to = Nan::ObjectWrap::Unwrap<KeccakWrapper>(info[0]->ToObject());
                                                               ~~~~~~~~~^~~~~~~~
/Users/leovct/Library/Caches/node-gyp/12.22.12/include/node/v8.h:2672:44: note: candidate function not viable: requires single argument 'context', but no arguments were provided
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                           ^
/Users/leovct/Library/Caches/node-gyp/12.22.12/include/node/v8.h:2686:31: note: candidate function not viable: requires single argument 'isolate', but no arguments were provided
                Local<Object> ToObject(Isolate* isolate) const);
                              ^
9 errors generated.
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 (/Users/leovct/.nvm/versions/node/v12.22.12/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:314:20)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)
gyp ERR! System Darwin 23.1.0
gyp ERR! command "/Users/leovct/.nvm/versions/node/v12.22.12/bin/node" "/Users/leovct/.nvm/versions/node/v12.22.12/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/leovct/Documents/work/clients/pos-portal/node_modules/ganache-cli/node_modules/keccak
gyp ERR! node -v v12.22.12
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] rebuild: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] rebuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/leovct/.npm/_logs/2023-11-22T09_26_09_121Z-debug.log
Keccak bindings compilation fail. Pure JS implementation will be used.

Fix

The node-scrypt repository used is deprecated and has not been updated in a long time. But a fix is available on the main branch of the repository - it was never released unfortunately.

This command will add this specific commit hash of scrypt as a dependency and will update package-lock.json accordingly.

$ npm install github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb

Now, if you simply run npm install, it should work fine! 🎉

$ npm install
npm WARN @babel/[email protected] requires a peer of @babel/core@^7.0.0-0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of bn.js@^4.11.0 but none is installed. You must install peer dependencies yourself.
npm WARN [email protected] requires a peer of @codechecks/client@^0.1.0 but none is installed. You must install peer dependencies yourself.

up to date in 5.135s

38 packages are looking for funding
  run `npm fund` for details

@leovct leovct closed this Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant