nodejs/nan

nan.h:318:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’

danwdart opened this issue · 11 comments

Hi

When trying to build iconv which deoends on this package I get the errors:

|
|

node-gyp rebuild

make: Entering directory '/home/dan/www/code/dartcomm/node_modules/iconv/build'
CC(target) Release/obj.target/libiconv/deps/libiconv/lib/iconv.o
AR(target) Release/obj.target/iconv.a
COPY Release/iconv.a
CXX(target) Release/obj.target/iconv/src/binding.o
In file included from ../src/binding.cc:18:0:
../../nan/nan.h:318:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of ‘v8::String’
static const unsigned kReplaceInvalidUtf8 = v8::String::REPLACE_INVALID_UTF8;
^
iconv.target.mk:99: recipe for target 'Release/obj.target/iconv/src/binding.o' failed
make: *** [Release/obj.target/iconv/src/binding.o] Error 1
make: Leaving directory '/home/dan/www/code/dartcomm/node_modules/iconv/build'

I'm using the latest node and npm from Debian sid (v0.10.38/1.4.21)

Could somebody help me on this please

Cheers

You're using the wrong headers somehow. The headers for 0.10.38 include
REPLACE_INVALID_UTF8
https://github.com/joyent/node/blob/v0.10.38/deps/v8/include/v8.h#L1083

On Thursday 13 August 2015 02:48:29 Dan Dart wrote:

Hi

When trying to build iconv which deoends on this package I get the errors:

iconv@2.1.10 install /home/dan/www/code/dartcomm/node_modules/iconv
node-gyp rebuild

make: Entering directory
'/home/dan/www/code/dartcomm/node_modules/iconv/build' CC(target)
Release/obj.target/libiconv/deps/libiconv/lib/iconv.o AR(target)
Release/obj.target/iconv.a
COPY Release/iconv.a
CXX(target) Release/obj.target/iconv/src/binding.o
In file included from ../src/binding.cc:18:0:
../../nan/nan.h:318:47: error: ‘REPLACE_INVALID_UTF8’ is not a member of
‘v8::String’ static const unsigned kReplaceInvalidUtf8 =
v8::String::REPLACE_INVALID_UTF8; ^
iconv.target.mk:99: recipe for target
'Release/obj.target/iconv/src/binding.o' failed make: ***
[Release/obj.target/iconv/src/binding.o] Error 1
make: Leaving directory
'/home/dan/www/code/dartcomm/node_modules/iconv/build'

I'm using the latest node and npm from Debian sid (v0.10.38/1.4.21)

Could somebody help me on this please

Cheers


Reply to this email directly or view it on GitHub:
#414

I speculate that the debian-packaged node is missing the REPLACE_INVALID_UTF8 patch from v0.10.29 (nodejs/node@881ac26). I suggest you ping the debian package maintainers about that. Maybe cc the maintainers of the libv8 package as well.

Install the Nodesource build instead. https://github.com/nodesource/distributions

@dandart I had the same issue on debian. It's not the node version, but the node-gyp that comes with npm 1.4.21.
Try upgrading to a newer version of node-gyp.

I just did a "npm -g install npm" to upgrade the debian's npm to npm's npm and that presumably included node-gyp and that fixed it so thanks...

however I'm getting other weird errors relating to node-stringprep which I'm not sure are related, but I can install node-stringprep on its own weirdly.

never mind - the stringprep bug turned out to be that I didn't have libicu-dev

Everything's fine now, thanks for your help

I just did a "npm -g install npm" to upgrade the debian's npm to npm's npm and that presumably included node-gyp and that fixed it so thanks...
Thanks, it works also fine to me

"npm -g install npm" works for me, too. :-)

Yes thank you that did work I am getting the information correctly now. I just have one more question is there a way to get the UUID and Major and Minor using Noble?

Raspberry Pi 3 checking in... just using sudo npm -g install npm didn't work but adding node-gyp did the trick

$ sudo npm -g install npm node-gyp

Update nodejs to the latest version will fix the issue.