Git Product home page Git Product logo

Comments (5)

kriscarle avatar kriscarle commented on August 22, 2024

@krystian50 check for error messages from npm install node-zopfli-es likely you are missing a prerequisite, it needs python, make, gcc, g++ etc. depending on the platform, see the notes at https://github.com/jaeh/node-zopfli-es

Since it is an "optional" dependency NPM will skip over it if there is an error so a full npm install will still complete.

from shrink-ray.

H-Gomez avatar H-Gomez commented on August 22, 2024

@krystian50 were you able to resolve this warning as we are getting it also.
Installed [email protected] directly with Yarn, no problems there.

On building the project I get a similar error:

warning  in ./node_modules/node-zopfli-es/lib/zopfli.js
Critical dependency: the request of a dependency is an expression
(node:10881) [ZOPFLI_COMPAT] MISSING_MODULE: Module "node-zopfli-es" was unavailable
Zopfli compression unavailable; will fall back to gzip.

from shrink-ray.

kriscarle avatar kriscarle commented on August 22, 2024

@H-Gomez @krystian50 any chance you are using Docker? or developing on a different platform and copying your node_modules? I just got this error on a new project because I forgot to add the .dockerignore ignoring node_modules and it was overwriting the native linux build with the files from my Mac.

You can get a better error message by running node -p "require('node-zopfli-es');" In my case I saw zopfli.node: Exec format error

from shrink-ray.

H-Gomez avatar H-Gomez commented on August 22, 2024

@kriscarle No docker is being used on the local development environment.
The platform is Mac OSX (10.14) on Node 10.13 and I've removed the node modules and done a fresh yarn to get all the packages installed again with no resolution.

When running the above command in the project root it returns the Zopli class indicating that it's able to find the package source correctly.

node -p "require('node-zopfli-es');"
{ [Function: Zopfli]
  createGzip: [Function],
  createZlib: [Function],
  createDeflate: [Function],
  compress: [Function],
  gzip: [Function],
  zlib: [Function],
  deflate: [Function],
  gzipSync: [Function],
  zlibSync: [Function],
  deflateSync: [Function] }

I can manually edit the zopli-compat.js inside of node_modules/shrink-ray-current/ to log out the error in the catch statement which gives me:

 warning  in ./node_modules/node-zopfli-es/lib/zopfli.js
(node:31489) [MODULE_NOT_FOUND] Error: Cannot find module './binding/zopfli.node'

This to me is confusing as I can see the zopfli.node file exists in node_modules/node-zopfli-es/lib/binding/.
Not entirely sure what else to try here.

from shrink-ray.

kriscarle avatar kriscarle commented on August 22, 2024

@H-Gomez Possibly something odd on your machine like a permissions issue? I'd recommend setting up a very simple hello world express app, then add shrink-ray-current to that and see if this happens in the simplest test case. If so, you could try upgrading NodeJS (10.13 is from October 2018) or use nvm or Docker to test different environments.

from shrink-ray.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.