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

Error: no viable conversion from 'v8::Local<v8::String>' to 'const char *' #735

Closed
bmathews opened this issue Feb 22, 2018 · 11 comments
Closed

Comments

@bmathews
Copy link

bmathews commented Feb 22, 2018

👋 I'm seeing a couple new electron-rebuild issues with the latest version of nan. Any immediate ideas?

An unhandled error occurred inside electron-rebuild
make: Entering directory '/opt/atlassian/pipelines/agent/build/src/node_modules/sharp/build'
  TOUCH Release/obj.target/libvips-cpp.stamp
  CXX(target) Release/obj.target/sharp/src/common.o
In file included from ../src/common.cc:24:0:
../../nan/nan.h: In constructor 'Nan::AsyncResource::AsyncResource(v8::Local<v8::String>, v8::Local<v8::Object>)':
../../nan/nan.h:1290:60: error: cannot convert 'v8::Local<v8::String>' to 'const char*' for argument '3' to 'node::async_context node::EmitAsyncInit__New(v8::Isolate*, v8::Local<v8::Object>, const char*, node::async_id)'
       context = node::EmitAsyncInit(isolate, resource, name);
                                                            ^
../../nan/nan.h: In constructor 'Nan::AsyncResource::AsyncResource(const char*, v8::Local<v8::Object>)':
../../nan/nan.h:1306:67: error: cannot convert 'v8::Local<v8::String>' to 'const char*' for argument '3' to 'node::async_context node::EmitAsyncInit__New(v8::Isolate*, v8::Local<v8::Object>, const char*, node::async_id)'
       context = node::EmitAsyncInit(isolate, resource, name_string);
An unhandled error occurred inside electron-rebuild
  SOLINK_MODULE(target) Release/.node
  CXX(target) Release/obj.target/fse/fsevents.o
In file included from ../fsevents.cc:6:
../../nan/nan.h:1290:56: error: no viable conversion from 'v8::Local<v8::String>' to 'const char *'
      context = node::EmitAsyncInit(isolate, resource, name);
                                                       ^~~~
/Users/formidable/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:578:53: note: passing argument to parameter 'name' here
                                        const char* name,
                                                    ^
In file included from ../fsevents.cc:6:
../../nan/nan.h:1306:56: error: no viable conversion from 'v8::Local<v8::String>' to 'const char *'
      context = node::EmitAsyncInit(isolate, resource, name_string);
                                                       ^~~~~~~~~~~
/Users/formidable/.electron-gyp/.node-gyp/iojs-1.8.2/src/node.h:578:53: note: passing argument to parameter 'name' here
                                        const char* name,
                                                    ^
In file included from ../fsevents.cc:85:
../src/methods.cc:14:12: warning: 'Call' is deprecated [-Wdeprecated-declarations]
  handler->Call(3, argv);
           ^
../../nan/nan.h:1568:3: note: 'Call' has been explicitly marked deprecated here
  Call(int argc, v8::Local<v8::Value> argv[]) const {
  ^
1 warning and 2 errors generated.
make: *** [Release/obj.target/fse/fsevents.o] Error 1

Pinning nan to 2.8.0 has fixed my builds for now.

@ddombrowsky
Copy link

I just ran into this also.

@marmos91
Copy link

marmos91 commented Feb 22, 2018

Same issue here.
Pinning nan to 2.8.0 has fixed my builds for now.

@kkoopa
Copy link
Collaborator

kkoopa commented Feb 22, 2018

Missing commit: nodejs/node@7b7c030

There is a discrepancy between versions of node 8 before 8.6, working on a fix.

ddombrowsky added a commit to ddombrowsky/node-usb-detection that referenced this issue Feb 22, 2018
Pinned nan to 2.8.0, unable to upgrade because of bug.
There is an upstream fix, but it is not released yet.
See nodejs/nan#735
@etherElric
Copy link

Just adding that this happens on mac, but not on Windows. It also is still an issue for us.

This was referenced Feb 22, 2018
@yussinsharp
Copy link

@etherElric That might be the first time I've ever heard of a node-related issue being fine on Windows but not on Mac haha

@kkoopa
Copy link
Collaborator

kkoopa commented Feb 22, 2018

It should not be platform-specific, but version-specific. It should only affect outdated versions of Node 8, namely all versions less than 8.6.0. As far as Electron goes, I don't know what version of Node a given version of Electron has.

@yussinsharp
Copy link

yussinsharp commented Feb 22, 2018

npm install is failing for me on CodeShip

node-version: 8.4.0
Breaking npm package: sharp

       > sharp@0.18.4 install /tmp/build_0ac47e96a42dd93042816461d782bbed/node_modules/sharp
       > node-gyp rebuild
       
       make: Entering directory '/tmp/build_0ac47e96a42dd93042816461d782bbed/node_modules/sharp/build'
       TOUCH Release/obj.target/libvips-cpp.stamp
       CXX(target) Release/obj.target/sharp/src/common.o
       In file included from ../src/common.cc:24:0:
       ../../nan/nan.h: In constructor ‘Nan::AsyncResource::AsyncResource(v8::Local<v8::String>, v8::Local<v8::Object>)’:
       ../../nan/nan.h:1290:60: error: cannot convert ‘v8::Local<v8::String>’ to ‘const char*’ for argument ‘3’ to ‘node::async_context node::EmitAsyncInit__New(v8::Isolate*, v8::Local<v8::Object>, const char*, node::async_id)’
       context = node::EmitAsyncInit(isolate, resource, name);
       ^
       ../../nan/nan.h: In constructor ‘Nan::AsyncResource::AsyncResource(const char*, v8::Local<v8::Object>)’:
       ../../nan/nan.h:1306:67: error: cannot convert ‘v8::Local<v8::String>’ to ‘const char*’ for argument ‘3’ to ‘node::async_context node::EmitAsyncInit__New(v8::Isolate*, v8::Local<v8::Object>, const char*, node::async_id)’
       context = node::EmitAsyncInit(isolate, resource, name_string);
       ^
       sharp.target.mk:119: recipe for target 'Release/obj.target/sharp/src/common.o' failed
       make: *** [Release/obj.target/sharp/src/common.o] Error 1
       make: Leaving directory '/tmp/build_0ac47e96a42dd93042816461d782bbed/node_modules/sharp/build'
       gyp ERR! build error
       gyp ERR! stack Error: `make` failed with exit code: 2
       gyp ERR! stack     at ChildProcess.onExit (/tmp/build_0ac47e96a42dd93042816461d782bbed/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
       gyp ERR! stack     at emitTwo (events.js:125:13)
       gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
       gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
       gyp ERR! System Linux 4.4.0-1012-aws
       gyp ERR! command "/tmp/build_0ac47e96a42dd93042816461d782bbed/.heroku/node/bin/node" "/tmp/build_0ac47e96a42dd93042816461d782bbed/.heroku/node/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
       gyp ERR! cwd /tmp/build_0ac47e96a42dd93042816461d782bbed/node_modules/sharp
       gyp ERR! node -v v8.4.0
       gyp ERR! node-gyp -v v3.6.2
       gyp ERR! not ok
       npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! sharp@0.18.4 install: `node-gyp rebuild`
       npm ERR! Exit status 1
       npm ERR!
       npm ERR! Failed at the sharp@0.18.4 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!     /tmp/npmcache.TW4A0/_logs/2018-02-22T21_22_53_448Z-debug.log
-----> Build failed

@yussinsharp
Copy link

I know you guys are working hard on it. Just wondering if there's an update. We are unable to release and easiest fix for us would be merging in this PR.

@kkoopa kkoopa closed this as completed Feb 22, 2018
@kkoopa
Copy link
Collaborator

kkoopa commented Feb 22, 2018

Done for now. 2.9.2 should work.

@ximendatie
Copy link

update the npm will solve this problem
npm i npm -g

@nawazm92
Copy link

nawazm92 commented Apr 5, 2022

update the npm will solve this problem npm i npm -g

worked for me, thanks @ximendatie

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

No branches or pull requests

8 participants