3

I'm playing with NodeJS and Electron. Using node 10.9.0 and boilerplate named electron-react-boilerplate.

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));
  ~~~~~~ 

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?

mdmb
  • 4,833
  • 7
  • 42
  • 90
  • I'm also still facing this issue. It definitely seems to be an issue with Node v10. There are many GitHub issues open for this, like [this one](https://github.com/nodejs/nan/issues/504). – J.W.F. Dec 12 '18 at 14:40
  • 1
    Possible duplicate of [Node sqlite node-gyp build error: no member named 'ForceSet' in 'v8::Object'](https://stackoverflow.com/questions/50111688/node-sqlite-node-gyp-build-error-no-member-named-forceset-in-v8object) – Ciro Santilli OurBigBook.com Feb 04 '19 at 09:06

3 Answers3

1

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.

Sinandro
  • 2,426
  • 3
  • 21
  • 36
Karl Casas
  • 805
  • 9
  • 9
1

This is possibly a problem with nan library. If so, uninstalling this and installing the latest version will solve the problem:

npm uninstall nan
npm install https://github.com/nodejs/nan
Sinandro
  • 2,426
  • 3
  • 21
  • 36
-1

I had just the same question as you ,and I change the node version from 10.19.0 to 8.17.0 and fixed. I hope this can help you

Jian Chen
  • 439
  • 5
  • 3