没有名为ForceSet的成员 [英] No member named ForceSet
问题描述
我正在使用NodeJS和Electron。使用节点 10.9.0
和名为 electron-react-boilerplate
的样板。
I'm playing with NodeJS and Electron. Using node 10.9.0
and boilerplate named electron-react-boilerplate
.
我已安装的所有NodeJS依赖项均正常运行,但是我需要安装一个本机模块。样板文档说要在 / app
目录中安装本机模块,所以我做到了,但是它把我扔了:
All of the NodeJS dependencies that I have installed were working correctly, but I need a native module to be installed. The boilerplate docs says to install native modules in the /app
directory and so I did, but it threw me:
../src/binding.cc:619:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<v8::String>("endianness").ToLocalChecked(), Nan::New<v8::String>(CheckEndianness()).ToLocalChecked(), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~ ^
../src/binding.cc:620:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<v8::String>("NULL").ToLocalChecked(), WrapNullPointer(), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~
我已将节点版本切换为 8.11.3
,并删除所有已安装的 node_modules
和 package-lock.json
文件并首先安装本机模块-安装完成。
I've switched my node version to 8.11.3
with deleting all of the installed node_modules
and package-lock.json
files and installed the native module first - the installation went through.
然后我切换到将模块安装到根目录中,然后得到:
Then I switched to install my modules in the root directory and I got:
Error: /usr/local/bin/node exited with code 1
Output:
> electron-react-boilerplate@1.0.0 postinstall /Users/nyc/Desktop/Electron/Project/app
> npm run electron-rebuild
> electron-react-boilerplate@1.0.0 electron-rebuild /Users/nyc/Desktop/Electron/Project/app
> node -r babel-register ../internals/scripts/ElectronRebuild.js
Error output:
An unhandled error occurred inside electron-rebuild
CXX(target) Release/obj.target/binding/src/binding.o
../src/binding.cc:360:23: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
String::Utf8Value str(in);
^
/Users/nyc/.electron-gyp/iojs-3.0.0-beta.3/deps/v8/include/v8.h:2819:5: note: 'Utf8Value' has been explicitly marked deprecated here
V8_DEPRECATED("Use Isolate version",
^
/Users/nyc/.electron-gyp/iojs-3.0.0-beta.3/deps/v8/include/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/binding.cc:435:23: warning: 'Utf8Value' is deprecated [-Wdeprecated-declarations]
String::Utf8Value str(in);
^
/Users/nyc/.electron-gyp/iojs-3.0.0-beta.3/deps/v8/include/v8.h:2819:5: note: 'Utf8Value' has been explicitly marked deprecated here
V8_DEPRECATED("Use Isolate version",
^
/Users/nyc/.electron-gyp/iojs-3.0.0-beta.3/deps/v8/include/v8config.h:321:29: note: expanded from macro 'V8_DEPRECATED'
declarator __attribute__((deprecated))
^
../src/binding.cc:619:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<v8::String>("endianness").ToLocalChecked(), Nan::New<v8::String>(CheckEndianness()).ToLocalChecked(), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~ ^
../src/binding.cc:620:11: error: no member named 'ForceSet' in 'v8::Object'
target->ForceSet(Nan::New<v8::String>("NULL").ToLocalChecked(), WrapNullPointer(), static_cast<PropertyAttribute>(ReadOnly|DontDelete));
~~~~~~ ^
有什么办法可以避免此错误?
Is there any way I can avoid this error?
推荐答案
我也遇到了这种情况。显然,某些软件包的节点v10有问题。我并没有深入了解为什么会这样。通过使用节点 npm install 7.10.0
的较低版本来解决此问题。
I also experienced this. Apparently, some packages have problems with node v10. I didn't really go deep with why that is the case. Fixed this by using a lower version of node npm install 7.10.0
.
这篇关于没有名为ForceSet的成员的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!