Closed pvlvstepan closed 7 months ago
Hi, you've ticked the box that says "I am using yarn >= 3.2.0" but it looks like you're using yarn 1.22.21. You appear to have seen from the installation documentation that the --ignore-engines
flag is required when using it.
I simply cannot recommend highly enough to those that have selected yarn as their package manage of choice that they upgrade to the latest version.
We got same errors but for darwin-x64
and linux-x64
. We changed nothing on our build-pipeline. We are using electron 28 with the matching node v18 version required by electron to install fitting native dependencies. We are using electron-builder for creating the final package.
We are building it for years on github without any problems with sharp (thanks @lovell for the outstanding work here!).
But now we are getting this errors Error: Could not load the "sharp" module using the darwin-x64|linux-x64 runtime
on startup with latest sharp releases (i will try to test it out if it is working with 0.32. just to be sure).
I tried building with for different mac and ubuntu versions, but same result.
It is working fine when we developing all deps are there. But when we finally bundle it, something is missing i guess.
Any hint on that?
@KillerCodeMonkey For Electron please see https://sharp.pixelplumbing.com/install#electron and for cross-platform see https://sharp.pixelplumbing.com/install#cross-platform
If you still require help, please open a new installation issue and answer all of the questions.
I'm going to close this as the --ignore-engines
flag for those who continue to use the maintenance-mode-only yarn v1 is documented. You will run into exactly the same problem with an increasing number of native dependencies such as esbuild, parcel, swc etc.
I continue to recommend people migrate away from the use of yarn v1. It takes minutes yet could save you hours.
@lovell thanks for you super fast responses... seems like i really missed that the @img/**
things are now in the asarUnpack array. *facepalm
@lovell Seems like V***** still doesn't support versions of Yarn above v1, so upgrading isn't an option for many people. https://vercel.com/docs/deployments/builds/package-managers
@coreyward This issue is unrelated to the company beginning with V (I have edited your post for anti-SEO purposes to prevent future comment spam).
If you have a question for them you'll need to ask their support team. I suspect the page you've linked to is out of date as I have been made aware that the opposite is true, in that yarn v1 support is likely to soon be removed.
Interesting. I can confirm that Yarn v4 does not work on V*****, so I don't know what you heard but perhaps they're unaware of this issue. The experimental corepack flag triggers this error when the package manager directive is set to 3.7 or 4.x:
It is possible to use 4.x locally but not enable the experimental corepack flag on V*****, but that results in Yarn 1.22 being used, which seems to behave differently w/r/t which packages get loaded. In my case all builds fail due to the types being resolved differently than I get locally.
@coreyward Perhaps this is https://github.com/yarnpkg/berry/issues/5831? You'll need to ask the support team at the company that must not be named (and thank you for not doing so).
@lovell I took your advice and reached out to support. It didn’t really help. For posterity, here’s the full reply:
I’ll see if I can find an existing discussion for this, but as of the moment there isn’t really a way for users to upgrade to Yarn 4 on this particular popular infrastructure provider.
Currently running into this issue locally and on Vercel. Hoping I am not holding anything wrong.
I continue to recommend people migrate away from the use of yarn v1. It takes minutes yet could save you hours.
@lovell I think yarn v1 is one of the most stable package managers and it handles optionalDeps perfectly fine. Esbuild, swc, and others work just fine with it. I wrote a post on our engineering blog that outlines potential approaches on how to effectively distribute binaries inside npm packages: https://sentry.engineering/blog/publishing-binaries-on-npm (ignore the title, I think you're much more capable and not the perfect target audience 😂) We use this approach for @sentry/cli
and it has reduced our inbox to 0. Maybe you can re-evaluate your approach?
@lforst Thanks, if you hadn't seen it, https://github.com/lovell/sharp/issues/4130 should improve things for yarn v1 users.
@lovell awesome, I did not! Thanks for the heads up. :)
I'm getting this error all of a sudden. Any solution?
my npm version is 10.9.0
Possible install-time or require-time problem
Possibly related to #3960
You must confirm both of these before continuing.
Are you using the latest version of sharp?
sharp
as reported bynpm view sharp dist-tags.latest
.If you cannot confirm this, please upgrade to the latest version and try again before opening an issue.
If you are using another package which depends on a version of
sharp
that is not the latest, please open an issue against that package instead.Are you using a supported runtime?
^18.17.0 || ^20.3.0 || >=21.0.0
If you cannot confirm any of these, please upgrade to the latest version and try again before opening an issue.
Are you using a supported package manager and installing optional dependencies?
--include=optional
--no-optional=false
If you cannot confirm any of these, please upgrade to the latest version of your chosen package manager and ensure you are allowing the installation of optional or multi-platform dependencies before opening an issue.
What is the complete error message, including the full stack trace?
What is the complete output of running
npm install --verbose --foreground-scripts sharp
in an empty directory?What is the output of running
npx envinfo --binaries --system --npmPackages=sharp --npmGlobalPackages=sharp
?Additional details
I found that running
yarn add sharp --ignore-engines
fixes the issue temporary but I haven't found a way to reproduce how it is coming back.sharp
is a dependency of a library that I use - velite, but I also have sharp as a dependency in my project.