Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn ignore cross-platform arguments #2926

Closed
sytolk opened this issue Oct 12, 2021 · 5 comments
Closed

yarn ignore cross-platform arguments #2926

sytolk opened this issue Oct 12, 2021 · 5 comments

Comments

@sytolk
Copy link

sytolk commented Oct 12, 2021

Did you see the documentation relating to installation?

yes

On MAC OS I'm installing sharp for linux like this: https://sharp.pixelplumbing.com/install#cross-platform

npm install --platform=win32 --arch=x64 - successful installed prebuilt binaries for Windows platform
yarn install --platform=win32 --arch=x64 - this install prebuilt binaries for darwin64 platform..

What is the output of running npx envinfo --binaries --system?

System:
OS: macOS 11.6
CPU: (6) x64 Intel(R) Core(TM) i5-8500B CPU @ 3.00GHz
Memory: 3.34 GB / 32.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.17.5 - ~/.nvm/versions/node/v14.17.5/bin/node
Yarn: 1.22.15 - /usr/local/bin/yarn
npm: 7.22.0 - ~/.nvm/versions/node/v14.17.5/bin/npm
Watchman: 2021.09.27.00 - /usr/local/bin/watchman

@lovell
Copy link
Owner

lovell commented Oct 12, 2021

https://sharp.pixelplumbing.com/install#cross-platform

These values can also be set via environment variables, npm_config_platform, npm_config_arch, npm_config_arm_version and SHARP_INSTALL_FORCE respectively.

@sytolk
Copy link
Author

sytolk commented Oct 13, 2021

This miss me.. Thanks @lovell maybe will be good to mention in doc that --platform=win32 --arch=x64 command line arguments works only with npm

@sytolk sytolk closed this as completed Oct 13, 2021
@sytolk
Copy link
Author

sytolk commented Oct 13, 2021

Not works with yarn and environmens too..

cross-env npm_config_platform=win32 npm_config_arch=x64 yarn install

npm_config_arm_version - I suppose that this is npm config environement -> yarn will skip it yarnpkg/yarn#4581

@sytolk sytolk reopened this Oct 13, 2021
@lovell
Copy link
Owner

lovell commented Oct 13, 2021

Running npm_config_platform=win32 yarn add sharp and, when there's a lockfile, npm_config_platform=win32 yarn install both install the correct binaries for me using yarn v1.22. (If you're using x64 then you won't need to worry about the ARM version.)

@sytolk
Copy link
Author

sytolk commented Oct 13, 2021

yes npm_config_platform=win32 yarn add sharp works thanks! This can be used instead of yarn install
What about this addition in doc:

These values can also be set via environment variables, npm_config_platform, npm_config_arch, npm_config_arm_version and SHARP_INSTALL_FORCE respectively.
yarn install ignore npm_config environment variables use yarn add instead

@sytolk sytolk closed this as completed Oct 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants