pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
438 stars 98 forks source link

npm install lz4@0.5.2 failing #103

Open mughal61 opened 4 years ago

mughal61 commented 4 years ago

Hello,

I am trying to download and install node packages and my package.json file does have the dependency lz4@0.5.2 that needs to be downloaded and installed but I am getting an error:

FYI I am using node version as v6.2.1 and this lz4@0.5.2 used to be working fine in the past.

npm install lz4@0.5.2

lz4@0.5.2 install /Users/username/Desktop/code/master/mobile/node_modules/lz4 node-gyp rebuild

CXX(target) Release/obj.target/lz4/lib/binding/lz4_binding.o clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] In file included from ../lib/binding/lz4_binding.cc:6: ../../nan/nan.h:59:10: fatal error: 'algorithm' file not found

include

     ^~~~~~~~~~~

1 error generated. make: *** [Release/obj.target/lz4/lib/binding/lz4_binding.o] Error 1 gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/Users/user/.nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23) gyp ERR! stack at emitTwo (events.js:106:13) gyp ERR! stack at ChildProcess.emit (events.js:191:7) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:204:12) gyp ERR! System Darwin 19.6.0 gyp ERR! command "/Users/user/.nvm/versions/node/v6.2.1/bin/node" "/Users/user/.nvm/versions/node/v6.2.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /Users/username/Desktop/code/master/mobile/node_modules/lz4 gyp ERR! node -v v6.2.1 gyp ERR! node-gyp -v v3.3.1 gyp ERR! not ok

npm ERR! Darwin 19.6.0 npm ERR! argv "/Users/user/.nvm/versions/node/v6.2.1/bin/node" "/Users/user/.nvm/versions/node/v6.2.1/bin/npm" "install" "lz4@0.5.2" "-stdlib=libc++" npm ERR! node v6.2.1 npm ERR! npm v3.9.3 npm ERR! code ELIFECYCLE

npm ERR! lz4@0.5.2 install: node-gyp rebuild npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the lz4@0.5.2 install script 'node-gyp rebuild'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the lz4 package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp rebuild npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs lz4 npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls lz4 npm ERR! There is likely additional logging output above.

Note: I've also tried running this cmd as suggested above in the error like npm install lz4@0.5.2 -stdlib=libc++

Thanks in advance!

ankon commented 4 years ago

The -stdlib=libc++ is a argument that would be needed on the compilation step, not on the npm install command.

That being said:

FYI I am using node version as v6.2.1 and this lz4@0.5.2 used to be working fine in the past.

So, what has changed since it worked? Did you update your system and/or compiler maybe?

NodeJS 6 is pretty much at the end of its useful life, and the node-lz4 package has also moved to a newer minor version (0.6.3, see #99).