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

[Bug] Unable to perform npm i when trying to contribute #1696

Closed
anirudh-modi opened this issue Jul 11, 2021 · 3 comments
Closed

[Bug] Unable to perform npm i when trying to contribute #1696

anirudh-modi opened this issue Jul 11, 2021 · 3 comments

Comments

@anirudh-modi
Copy link

Hi @profnandaa @chriso I wanted to contribute to repo.. so I forked and cloned the repo, however, when I am doing an npm i... I am getting error while installing weak module

 weak@1.0.1 install /Users/anirudhmodi/Documents/oss/validator.js/node_modules/weak
> node-gyp rebuild

  CXX(target) Release/obj.target/weakref/src/weakref.o
../src/weakref.cc:147:25: error: too few arguments to function call, expected 4, have 3; did you mean 'Nan::Call'?
  globalCallbackDirect->Call(Nan::GetCurrentContext()->Global(), 1, argv);
                        ^~~~
                        Nan::Call
../../nan/nan_maybe_43_inl.h:345:30: note: 'Nan::Call' declared here
inline MaybeLocal<v8::Value> Call(
                             ^
../src/weakref.cc:168:75: error: too few arguments to function call, single argument 'context' was not specified
  Local<Object> proxy = Nan::New<ObjectTemplate>(proxyClass)->NewInstance();
                        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/anirudhmodi/Library/Caches/node-gyp/12.18.2/include/node/v8.h:6423:3: note: 'NewInstance' declared here
  V8_WARN_UNUSED_RESULT MaybeLocal<Object> NewInstance(Local<Context> context);
  ^
/Users/anirudhmodi/Library/Caches/node-gyp/12.18.2/include/node/v8config.h:368:31: note: expanded from macro 'V8_WARN_UNUSED_RESULT'
#define V8_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
                              ^
../src/weakref.cc:223:55: error: no member named 'IsNearDeath' in 'Nan::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >'
  Local<Boolean> rtn = Nan::New<Boolean>(cont->target.IsNearDeath());
                                         ~~~~~~~~~~~~ ^
3 errors generated.

On further investigation I found, the error is coming when we are installing rollup, and the version which is used in the repo, is quite old, where they are using weak module, and there is already an issue present in the node-weak which suggests that we should use weak-napi, which is already there in the latest rollup version.
Link to issue: TooTallNate/node-weak#99

My environment details

Node: v12.18.2
Npm: 6.14.2

Now, this could be perhaps solved if we change the version of rollup, but that will be a breaking change with huge impact.

If you have a better solution, let me know about the same.. so that I can contribute..

@profnandaa
Copy link
Member

@anirudh-modi -- can do a PR to fix this? Thanks for noting!

@rubiin
Copy link
Member

rubiin commented Jul 16, 2021

@profnandaa i will do a quick fix asap

@rubiin
Copy link
Member

rubiin commented Jul 16, 2021

#1697 solved here. @profnandaa i would also like to update other deps as they are way old on next PR maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants