srs / gradle-node-plugin

Gradle plugin for integrating NodeJS in your build. :rocket:
Apache License 2.0
865 stars 211 forks source link

Yarn: add support for preferred yarn installation method #175

Open almilo opened 7 years ago

almilo commented 7 years ago

Installing yarn through npm produces the warning: "It is recommended to install Yarn using the native installation method for your environment" As yarn itself is a replacement for npm, it would be nice to have yarn installed without relying on npm. What would also get rid of the annoying warning :)

Pinging @kaitoy to get his input on this.

Thanks for the great work! Alberto

kaitoy commented 7 years ago

Yarn used to be suggesting to use NPM for its installation but now... It seems Yarn is not providing a platform dependent way to install nor a way to install it to specified path other than NPM. The latter is required to avoid the plugin's changing users' global environment.

mattbrictson commented 7 years ago

You can install Yarn in a platform-independent manner to any desired path by downloading and extracting the tarball (https://yarnpkg.com/latest.tar.gz), as documented here:

https://yarnpkg.com/en/docs/install#manual-install-via-tarball

srs commented 7 years ago

That could be done. But should we be able to se yarn version? Is yarn having an archive with old tarballs?

kaitoy commented 7 years ago

I read Yarn install script; https://yarnpkg.com/install.sh. This uses https://yarnpkg.com/downloads/$version/yarn-v$version.tar.gz to download the specified version of Yarn. I confirmed this URL works for the oldest version 0.14.0.

henrik242 commented 7 years ago

Yarn install with npm currently fails for us, as of some hours ago, when bl@1.2.0 was released. bl@1.1.2 works, see https://github.com/yarnpkg/yarn/issues/1774#issuecomment-268789938

We work around this locally by overriding yarnSetup to use the preferred installation method (downloading and unpacking the tgz).

almilo commented 7 years ago

any progress on this? we are having issues when installing yarn through npm.

zman2245 commented 7 years ago

I too am having issues, such as the following: https://github.com/yarnpkg/yarn/issues/2915

seshness commented 7 years ago

There's an even easier-to-use yarn distribution. yarn bundles a single JavaScript file with each release:

Did you know that Yarn is also distributed as a single bundle JS file in releases that can be used on CI systems without internet access?

https://yarnpkg.com/blog/2016/11/24/offline-mirror/

MikeN123 commented 7 years ago

What is the status of this issue? I see a PR, but there does not seem to happen a lot.

The current way of working is unreliable. Our build broke all of a sudden, simply because the npm installer fetched another version for a yarn dependency...