Weak not compatible with node 12
- Lenguaje dominante
- TypeScript
- Estrellas
- 8.1k
- Forks
- 1.5k
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
### Issue type
**I'm submitting a ...** (check one with "x")
* [x] bug report
* [ ] feature request
### Issue description
**Current behavior:**
npm install failes due to incompatibility between weak and node 12.x
**Expected behavior:**
npm install should not fail
**Steps to reproduce:**
Install node 12.x and run npm install in clean checkout of nebular
Also see this thread: https://github.com/TooTallNate/node-weak/issues/99
**Related code:**
```
> weak@1.0.1 install /Users/xxx/Dev/xxx/test/nebular/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:358:30: note: 'Nan::Call' declared here
inline MaybeLocal Call(
^
../src/weakref.cc:168:75: error: too few arguments to function call, single argument 'context' was not specified
Local proxy = Nan::New(proxyClass)->NewInstance();
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
/Users/bartpappyn/Library/Caches/node-gyp/12.16.1/include/node/v8.h:6423:3: note: 'NewInstance' declared here
V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(Local context);
^
/Users/bartpappyn/Library/Caches/node-gyp/12.16.1/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 >'
Local rtn = Nan::New(cont->target.IsNearDeath());
~~~~~~~~~~~~ ^
3 errors generated.
make: *** [Release/obj.target/weakref/src/weakref.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack at ChildProcess.emit (events.js:311:20)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
gyp ERR! System Darwin 19.2.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/bartpappyn/Dev/furoo/test/nebular/node_modules/weak
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
```
### Other information:
**npm, node, OS, Browser**
```
Node, npm: v12.16.1 and 6.13.4
OS:macOS (Catalina)
Guía de contribución
Evaluación
Este issue todavía no se ha evaluado.