Giter Club home page Giter Club logo

Comments (11)

chearon avatar chearon commented on August 13, 2024

Shouldn't having it in dependencies ensure node-pre-gyp is present? It sounds like bundledDependencies copies dependencies into the tarball before publishing, but we shouldn't have to force people to have multiple copies of node-pre-gyp.

from node-canvas-prebuilt.

zbjornson avatar zbjornson commented on August 13, 2024

Yeah, Mapbox doesn't recommend it anymore:

Note: in the past we recommended putting node-pre-gyp in the bundledDependencies, but we no longer recommend this. In the past there were npm bugs (with node versions 0.10.x) that could lead to node-pre-gyp not being available at the right time during install (unless we bundled). This should no longer be the case.

https://github.com/mapbox/node-pre-gyp/blob/master/README.md

from node-canvas-prebuilt.

yiochen avatar yiochen commented on August 13, 2024

I am also confused. This seems to be an issue with npm ci.
I managed to work around it by adding node-pre-gyp to my package.json

from node-canvas-prebuilt.

chearon avatar chearon commented on August 13, 2024

Yeah... seems like a bug in npm. Feel free to re-open if you find otherwise.

from node-canvas-prebuilt.

Pumpuli avatar Pumpuli commented on August 13, 2024

I think that npm is working as intended and this is actually an issue with canvas-prebuilt. It has been fixed too for over a year, but only in v2 alphas (#13). I wonder if it's possible to backport that fix to the latest tag too?

The isssue is that npm dedupes node-pre-gyp to top-level but the install script of canvas-prebuilt assumes that it's found in its own node_modules folder.

I.e. assumed structure:

project-root
└ node_modules
  └ canvas-prebuilt
    └ node_modules
       └ node-pre-gyp

Actual structure:

project-root
└ node_modules
  ├ canvas-prebuilt
  └ node-pre-gyp

from node-canvas-prebuilt.

Pumpuli avatar Pumpuli commented on August 13, 2024

Turns out the install script doesn't work at all on Windows native command line due to it having forward slashed and no quotes. This was of course the original reason for #13, it just also happened to fix the missing node-pre-gyp issue.

@chearon could this fix be backported to latest package too (i.e. version 1.x)?

from node-canvas-prebuilt.

chearon avatar chearon commented on August 13, 2024

Yeah sorry, I'll try to do that soon, someone else just asked for it in #51.

from node-canvas-prebuilt.

lavor avatar lavor commented on August 13, 2024

Can you publish that 1.6.12 version, please. The npm ci still doesn't work.

from node-canvas-prebuilt.

chearon avatar chearon commented on August 13, 2024

Sorry I missed that, it's been difficult supporting 1.x which is an old/broken build and the 2.x series and build.

I pushed the commit @Pumpuli mentioned to the 1.x build branch for the next release. As for a 1.6.12, version of canvas-prebuilt, I screwed that up a while back and unpublished it because it accidentally included canvas as a dependency 🤦‍♂️ so should I:

I'm not sure which is worse

from node-canvas-prebuilt.

lavor avatar lavor commented on August 13, 2024

Thank you for your answer, I think the latter is better, but it is just my opinion.
I can use 2.x if it is working there, but I see it as alpha version. Is it stable now?

from node-canvas-prebuilt.

zbjornson avatar zbjornson commented on August 13, 2024

There's one known regression in both 2.x and 1.6.12 (Automattic/node-canvas#1249). It has a PR to fix it that needs to be reviewed. Otherwise 2.x is stable.

from node-canvas-prebuilt.

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.