pierrec / node-lz4

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

Ubuntu 14.04 - Cannot find module '../build/Release/xxhash' #40

Open ndmgrphc opened 8 years ago

ndmgrphc commented 8 years ago

Not sure how to fix this. There were no errors on npm install. I tried node-gyp rebuild and got a host of other (presumably) unrelated errors. Using node v4.4.5 with npm 2.15.5 here and can't get lz4 going like I could on osx (fwiw).

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.4 LTS
Release:    14.04
Codename:   trusty
"lz4": "^0.5.2",
module.js:327
    throw err;
    ^

Error: Cannot find module '../build/Release/xxhash'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/var/app/node_modules/lz4/lib/utils.js:4:11)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at Object.<anonymous> (/var/app/node_modules/lz4/lib/static.js:60:17)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
pierrec commented 8 years ago

Humm. I just did the install on Ubuntu 14.04 with node 4.4.6 and it worked fine:

vagrant@vagrant-ubuntu-trusty-64:~/sandbox/node-lz4$ npm i npm WARN package.json lz4@0.5.2 No license field.

> lz4@0.5.2 install /home/vagrant/sandbox/node-lz4
> node-gyp rebuild

make: Entering directory `/home/vagrant/sandbox/node-lz4/build'
  CXX(target) Release/obj.target/lz4/lib/binding/lz4_binding.o
  CC(target) Release/obj.target/lz4/deps/lz4/lib/lz4.o
  CC(target) Release/obj.target/lz4/deps/lz4/lib/lz4hc.o
  SOLINK_MODULE(target) Release/obj.target/lz4.node
  COPY Release/lz4.node
  CXX(target) Release/obj.target/xxhash/lib/binding/xxhash_binding.o
  CC(target) Release/obj.target/xxhash/deps/lz4/lib/xxhash.o
  SOLINK_MODULE(target) Release/obj.target/xxhash.node
  COPY Release/xxhash.node
make: Leaving directory `/home/vagrant/sandbox/node-lz4/build'

> lz4@0.5.2 prepublish /home/vagrant/sandbox/node-lz4
> ./build.sh

vagrant@vagrant-ubuntu-trusty-64:~/sandbox/node-lz4$ ls build
binding.Makefile  config.gypi  lz4.js  lz4.min.js  lz4.target.mk  Makefile  Release  xxhash.target.mk
vagrant@vagrant-ubuntu-trusty-64:~/sandbox/node-lz4$ ls build/Release/
lz4.node  obj.target  xxhash.node
vagrant@vagrant-ubuntu-trusty-64:~/sandbox/node-lz4$ node --version
v4.4.6
vagrant@vagrant-ubuntu-trusty-64:~/sandbox/node-lz4$ 
rvetere commented 7 years ago

Having the same issue but in a total different situation - we're having a total fancy project here with webpack@2.beta.25... with two entry points... one for local development, the other for proudction with full SSR on node.js.

Now when i include lz4 - and startup the dev environment.. everything is fine and webpack can bundle everything.

But as soon as i try to build and start the production env/mode - it fails with the exact same Error:

Error: Cannot find module '../build/Release/xxhash'

I totally don't understand what could cause this 😕

Rolandisimo commented 5 years ago

Upping this issue, since it's still relevant for my project as well

ankur-lahoti commented 4 years ago

Getting similar error trying to use LZ4 in an angular project.

Module not found: Error: Can't resolve '../build/Release/lz4' in '../Angular-HelloWorld/node_modules/lz4/lib' ERROR in ./node_modules/lz4/lib/utils.js Module not found: Error: Can't resolve '../build/Release/xxhash' in '../Angular-HelloWorld/node_modules/lz4/lib' ERROR in ./node_modules/lz4/lib/decoder_stream.js Module not found: Error: Can't resolve 'stream' in '../Angular-HelloWorld/node_modules/lz4/lib' ERROR in ./node_modules/lz4/lib/encoder_stream.js Module not found: Error: Can't resolve 'stream' in '../Angular-HelloWorld/node_modules/lz4/lib'

JosephP91 commented 3 years ago

Same thing on my side, but not for xxhash:

Module not found: Can't resolve '../build/Release/lz4' in '/Users/giuseppepersico/Github/perspective-test/node_modules/lz4/lib'