Почему npm устанавливает ошибку возврата ffi. Использование версии узла 12 - PullRequest
2 голосов
/ 31 мая 2019

Я новичок в nodejs. Я пытаюсь вызвать c ++ API в dll из node-js. До сих пор я обнаружил, что ffi можно использовать для этого. Я следовал инструкциям по установке и установил необходимые инструменты сборки. Но когда я запускаю npm install ffi, я получаю следующие ошибки.

Я что-то не так делаю?

**d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(222): error C2661: 'v8::Value:
:BooleanValue': no overloaded function takes 0 arguments**
 [D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node
_modules\ref\build\binding.vcxproj]
d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(253): error C2660: 'v8::Value:
:Uint32Value': function does not take 0 arguments [D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node_module
s\ref\build\binding.vcxproj]
  c:\users\nikhe\.node-gyp\12.0.0\include\node\v8.h(2567): note: see declaration of 'v8::Value::Uint32Value' (compiling
   source file ..\src\binding.cc)
d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(360): error C2664: 'v8::String
::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot convert argument 1 from 'v8::Local<v8::Value>' to 'const
 v8::String::Utf8Value &' [D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node_modules\ref\build\binding.vcxp
roj]
  d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(360): note: Reason: cannot c
  onvert from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value'
  d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(360): note: No user-defined-
  conversion operator available that can perform this conversion, or the operator cannot be called
d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(447): error C2664: 'v8::String
::Utf8Value::Utf8Value(const v8::String::Utf8Value &)': cannot convert argument 1 from 'v8::Local<v8::Value>' to 'const
 v8::String::Utf8Value &' [D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node_modules\ref\build\binding.vcxp
roj]
  d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(447): note: Reason: cannot c
  onvert from 'v8::Local<v8::Value>' to 'const v8::String::Utf8Value'
  d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(447): note: No user-defined-
  conversion operator available that can perform this conversion, or the operator cannot be called
d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(521): error C2660: 'v8::Value:
:Uint32Value': function does not take 0 arguments [D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node_module
s\ref\build\binding.vcxproj]
  c:\users\nikhe\.node-gyp\12.0.0\include\node\v8.h(2567): note: see declaration of 'v8::Value::Uint32Value' (compiling
   source file ..\src\binding.cc)
d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\ref\src\binding.cc(550): error C2660: 'v8::Value:
:Uint32Value': function does not take 0 arguments [D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node_module
s\ref\build\binding.vcxproj]
.
.
.
. d:\codelathe\electronpoc\practice\dll\electroncallingdll\node_modules\nan\nan_maybe_43_inl.h(117): note: see declarat
  ion of 'Nan::ForceSet'
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at ChildProcess.emit (events.js:196:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:256:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\node_modules\ref
gyp ERR! node -v v12.0.0
gyp ERR! node-gyp -v v3.8.0
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open 'D:\CodeLathe\ElectronPOC\Practice\dll\ElectroncallingDll\package.json'
npm WARN ElectroncallingDll No description
npm WARN ElectroncallingDll No repository field.
npm WARN ElectroncallingDll No README data
npm WARN ElectroncallingDll No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ref@1.3.5 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ref@1.3.5 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!     C:\Users\nikhe\AppData\Roaming\npm-cache\_logs\2019-05-31T10_07_30_614Z-debug.log
...