Error installing NPM "sse4_crc32"

I initially received this error as a dependency for another package, but it fails when I tried it myself too. Since this is the first time I am trying to install the node.js package, I am sure that I am missing something, but what?

  $ npm install --save sse4_crc32
 \
 > sse4_crc32@3.3.0 install / home / agam / node_modules / sse4_crc32
 > node-gyp rebuild

 make: Entering directory '/ home / agam / node_modules / sse4_crc32 / build'
   CXX (target) Release / obj.target / sse4_crc32 / src / sse4_crc32.o
 In file included from ../src/sse4_crc32.cpp:18:07:
 ../node_modules/nan/nan.h: In constructor 'Nan :: Utf8String :: Utf8String (v8 :: Local)':
 ../node_modules/nan/nan.h:1178:27: error: 'REPLACE_INVALID_UTF8' is not a member of 'v8 :: String'
                            v8 :: String :: REPLACE_INVALID_UTF8;
                            ^
 sse4_crc32.target.mk:87: recipe for target 'Release / obj.target / sse4_crc32 / src / sse4_crc32.o' failed
 make: *** [Release / obj.target / sse4_crc32 / src / sse4_crc32.o] Error 1
 make: Leaving directory '/ home / agam / node_modules / sse4_crc32 / build'
+4
source share
2 answers

On the same day, a problem arises.

I was on Node 0.10.29, which supposedly should work. Updated to Node 0.10.38, but this did not solve the problem.

I worked on debian (jessy), and npm was installed there, pulling out the old version of node -gyp as a dependency. 0.2.0 I find that for npm 1.4.x.

Installing a new version of node -gyp through npm install -g solved the problem. (After some symbolic links are changed to point to a new node -gyp).

+3
source

I assume that you are using node v0.11.12 or an earlier version of v0.11 that would not have v8::String::REPLACE_INVALID_UTF8 (available since v0.11.13 when v8 was updated to 3.24.x from 3.22.x) . node versions v0.11.x are considered unstable, and you should upgrade them to at least v0.12. After that, the error should disappear.

A more technical cause of the error is that nan simply checks to see if there is a version of node ABI post-v0.10 around the code that uses v8::String::REPLACE_INVALID_UTF8 , so it is assumed that you are using v0.12 or later, where this constant is available.

+3
source

All Articles