Git Product home page Git Product logo

steps-yarn's Introduction

Run yarn command

Step changelog

Runs yarn with the given command and args.

Description

Yarn is a package manager that is compatible with the npm registry. Download your app's dependencies via yarn by using this Step.

Configuring the Step

To use the Step, you need to configure your dependencies in your package.json file.

  1. Set a command in The yarn command to run input.

    If you leave the input blank, the Step will simply install your dependencies. You can find the other available command in yarn's documentation.

  2. Set the arguments in the Arguments for running yarn commands input.

    You can specify multiple arguments. Check out the available arguments for each command in yarn's documentation.

You can also cache the contents of the node_modules directory by setting the Cache node_modules input to yes.

Troubleshooting

If the Step fails, run it again with verbose logging enabled. To do so, set the Enable verbose logging input to yes. Doing so allows yarn to output more information about the command you ran.

Make sure your commands and arguments are correct, and that your packages are correctly defined in the package.json file.

Useful links

Getting started with React Native apps Running Detox tests on Bitrise

Related Steps

Run Cocoapods install Run npm command

🧩 Get started

Add this step directly to your workflow in the Bitrise Workflow Editor.

You can also run this step directly with Bitrise CLI.

⚙️ Configuration

Inputs
Key Description Flags Default
workdir Working directory of the step. You can leave it empty to not change it. $BITRISE_SOURCE_DIR
command Specify the command to run with yarn. For example add. Leave it blank to install dependencies.
args Arguments are added to the yarn command. You can specify multiple arguments, separated by a space character. For example react or -dev
cache_local_deps Select if the contents of node_modules directory should be cached. yes: Mark local dependencies to be cached. no: Do not use cache. All node_modules folders (recursively) located under the working directory will be cached. required no
verbose_log Choose if debug logging is enabled. required no
Outputs There are no outputs defined in this step

🙋 Contributing

We welcome pull requests and issues against this repository.

For pull requests, work on your changes in a forked repository and use the Bitrise CLI to run step tests locally.

Learn more about developing steps:

steps-yarn's People

Contributors

bitrise-coresteps-bot avatar godrei avatar jonoirwinrsa avatar lpusok avatar nilswloka avatar radko93 avatar reidab avatar renovate[bot] avatar richard-bogdan-bitrise avatar trapacska avatar viktorbenei avatar zoltan-baba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

steps-yarn's Issues

yarn install step fails

From today all Bitrise Builds fails on yarn install step. Even old builds that finished successfully recently now are failing.

Please help with this problem, the testing process is blocked because of it.

Using: Arguments for running `yarn` commands

In the field Arguments for running yarn commands, there is example global. Which indicates, if I want to install package globally I can put add cli-tool and in the arguments put global to have package installed globally.
But actual result is: yarn add cli-tool global. So correct way is to skip the arguments field and just put this in run field: global add cli-tool.

Would it be possible to remove global as example? Since I feel it might be misleading.

npm-force-resolutions EACCES: permission denied

Troubleshooting

  • I've searched discuss.bitrise.io for possible solutions.
  • Which version of the step is effected? 0.0.10
  • Is the issue reproducible with the latest version? YES
  • Does the issue happen sporadically, or every time? EVERY TIME
  • Is the issue reproducible locally by following our local debug guide? NOT APPLICABLE

Useful information

Issue description

Bitrise info

   
     [4/4] Building fresh packages...
$ npx npm-force-resolutions && patch-package
Error: EACCES: permission denied, open './package-lock.json'
    at Object.openSync (node:fs:594:3)
    at Object.fs [as writeFileSync] (node:fs:2207:35)
    at npm_force_resolutions$core$node_spit (/bitrise/src/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:19:21)
    at switch__2144__auto__ (/bitrise/src/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:167:3)
    at /bitrise/src/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.cljs:167:3
    at npm_force_resolutions$core$state_machine__2145__auto____1 (/bitrise/src/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.js:818:4)
    at cljs.core.async.impl.ioc-helpers/FN-IDX (/bitrise/src/node_modules/npm-force-resolutions/out/npm_force_resolutions/core.js:834:66)
    at cljs.core.async.impl.ioc-helpers/run-state-machine (/bitrise/src/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:35:23)
    at cljs.core.async.impl.ioc-helpers/run-state-machine-wrapped (/bitrise/src/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:39:6)
    at /bitrise/src/node_modules/npm-force-resolutions/out/cljs/core/async/impl/ioc_helpers.cljs:48:39
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Run: provided yarn command failed: exit status 1
  

Steps to reproduce

  1. push build
  2. see build fail

Hi guys, We're having an issue with npm-force-resolutions in our React Native App. I've separated the App into 2 Apps Android and iOS. However, when we tried to apply npm-force-resolutions for fixing some vulnerabilities. The iOS build successfully but the Android.
Any suggestions please? Really appreciate it. Thanks. Hope to hear from you guys soon. It's urgent.

The build images are attached below.

Screen Shot 2022-10-13 at 22 23 11

Screen Shot 2022-10-13 at 22 23 35

yarn install fails

Troubleshooting

  • I've searched discuss.bitrise.io for possible solutions.
  • Which version of the step is effected? 0.1.1
  • Is the issue reproducible with the latest version? YES
  • Does the issue happen sporadically, or every time? SPORADIC (but OFTEN)
  • Is the issue reproducible locally by following our local debug guide? NOT APPLICABLE

Useful information

Issue description

Workflow fails on yarn install step. Seems to fail with one of:

[2/4] Fetching packages...
error An unexpected error occurred: "ENOENT: no such file or directory, scandir '/Users/vagrant/Library/Caches/Yarn/v6/npm-eslint-utils-2.1.0-d2de5e03424e707dc10c74068ddedae708741b27-integrity/node_modules/eslint-utils'".
[2/4] Fetching packages...
error https://registry.yarnpkg.com/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, open '/Users/vagrant/Library/Caches/Yarn/v6/npm-prettier-linter-helpers-1.0.0-d23d41fe1375646de2d0104d3454a3008802cf7b-integrity/node_modules/prettier-linter-helpers/.prettierignore'"
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

The package being fetched may be different, but it invariably fails during the Fetching packages stage.

Bitrise info

warning react-native > @react-native-community/cli > metro > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning react-native > @react-native-community/cli > metro > jest-haste-map > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
[2/4] Fetching packages...
error An unexpected error occurred: "ENOENT: no such file or directory, scandir '/Users/vagrant/Library/Caches/Yarn/v6/npm-eslint-utils-2.1.0-d2de5e03424e707dc10c74068ddedae708741b27-integrity/node_modules/eslint-utils'".
info If you think this is a bug, please open a bug report with the information provided in "/Users/vagrant/git/native/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
�[31;1mYarn command failed, error: exit status 1�[0m
  

Steps to reproduce

  1. push build
  2. see build fail

Yarn steps not working anymore

Troubleshooting

  • [x ] I've searched discuss.bitrise.io for possible solutions.
  • Which version of the step is effected? 1.2.3
  • Is the issue reproducible with the latest version? YES
  • Does the issue happen sporadically, or every time? EVERY TIME
  • Is the issue reproducible locally by following our local debug guide? NO

Useful information

Issue description

Bitrise info

 Config:
- workdir: /Users/vagrant/git
- command: 
- args: 
- cache_local_deps: false
- verbose_log: true

Yarn is already installed at: /opt/homebrew/bin/yarn

Yarn version:

$ yarn "--version"

No preset version installed for command node
Please install a version by running one of the following:

asdf install nodejs 18

or add one of the following versions in your config file at /Users/vagrant/.tool-versions
nodejs 12.22.9
nodejs 16.19.1
nodejs 19.8.1

Install dependencies: yarn version command failed: exit status 126

Steps to reproduce

The steps are the same as they've always been. Basically the default yarn command.

• I also tried with npm as well (generated new npm lock file, deleted yarn lock, changed the step to npm)
• I also tried a script as the first step in the workflow to install node, like the log suggested. It said node was already installed.

Yarn install step not working after Bitrise 11-06-2023 Stack update

Troubleshooting

  • I've searched discuss.bitrise.io for possible solutions.
  • Which version of the step is effected? 1.2.3
  • Is the issue reproducible with the latest version? YES
  • Does the issue happen sporadically, or every time? EVERY TIME
  • Is the issue reproducible locally by following our local debug guide? NOT APPLICABLE

Useful information

Issue description

After the Bitrise stack update from 11-06-2023, the Yarn Install step isn't working for me.
Changelog: https://stacks.bitrise.io/changelogs/linux-docker-android-20.04/#stack-update-v2023-11-06:~:text=Updates%20%23-,Stack%20update,-v2023%2D11%2D06

Here is my Project's .tool-versions file:

ruby 3.2.1
nodejs 18.14.2
yarn 1.22.10

Bitrise info

  • Build URL: https://app.bitrise.io/build/04a7aa1a-23e0-4911-bed9-c3c3041eb8d1

  • Bitrise Support enabled: YES / NO

  • Log:

        ;[REDACTED]mConfig:
        - workdir: /bitrise/src
        - command: 
        - args: 
        - cache_local_deps: false
        - verbose_log: false
        ;[REDACTED]mYarn is already installed at: /root/.asdf/shims/yarn
        ;[REDACTED]mYarn version:
        ;[REDACTED]m$ yarn "--version"
        No preset version installed for command yarn
        Please install a version by running one of the following:
        
        asdf install nodejs 18.14.2
        
        or add one of the following versions in your config file at /bitrise/src/.tool-versions
        
        nodejs 16
        nodejs 16.20
        nodejs 16.20.2
        [REDACTED];[REDACTED]mInstall dependencies: yarn version command failed: exit status [REDACTED]26
    

Steps to reproduce

Run Yarn Install step any multistep workflow:
Screenshot 2023-11-09 at 4 08 52 PM

Seeing issues with yarn install on Bitrise Mac stack machines

error https://registry.yarnpkg.com/jsdom/-/jsdom-11.12.0.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, stat '/Users/vagrant/Library/Caches/Yarn/v5/npm-jsdom-11.12.0-1a80d40ddd378a1de59656e9e6dc5a3ba8657bc8/node_modules/jsdom/lib/jsdom/living/generated/HTMLObjectElement.js'"

Looks like theres an issue with the cache that the yarn install step is trying to load packages from?

Issue running yarn command `danger` with `ci` arguments in Bitrise UI

I have a step in my .yml file that looks like this:

    - [email protected]:
        inputs:
        - args: ci
        - command: danger
        is_always_run: true
        title: Danger

However, the output from my build on Bitrise is:

+------------------------------------------------------------------------------+

| (4) [email protected]                                                               |
+------------------------------------------------------------------------------+
| id: yarn                                                                     |
| version: 0.0.4                                                               |
| collection: https://github.com/bitrise-io/bitrise-steplib.git                |
| toolkit: bash                                                                |
| time: 2018-02-07T07:21:13-08:00                                              |
+------------------------------------------------------------------------------+
|                                                                              |
INFO[07:21:13]  * [OK] Step dependency (node) installed, available. 
INFO[07:21:13]  * [OK] Step dependency (yarn) installed, available. 
==> Switching to working directory: /Users/vagrant/git
yarn run v1.3.2
$ /Users/vagrant/git/node_modules/.bin/danger
  Usage: danger [options] [command]
  Options:
    -V, --version  output the version number
    -h, --help     output usage information
  Commands:
    init        Helps you get started with Danger
    ci          Runs Danger on CI
    process     Like `ci` but lets another process handle evaluating a Dangerfile
    pr          Runs your local Dangerfile against an existing GitHub PR. Will not post on the PR
    runner      Runs a dangerfile against a DSL passed in via STDIN [You probably don't need this]
    local       Runs danger standalone on a repo, useful for git hooks
    help [cmd]  display help for [cmd]
  Docs:
    -> Getting started:
       http://danger.systems/js/guides/getting_started.html
    -> The Dangerfile
       http://danger.systems/js/guides/the_dangerfile.html
    -> API Reference
       http://danger.systems/js/reference.html
Done in 0.30s.

I suspect this is due to this: https://github.com/jonoirwinrsa/steps-yarn/blob/master/step.yml#L36,
where it looks like the arguments are passed to a variable command and args, but the script only references command: https://github.com/jonoirwinrsa/steps-yarn/blob/master/step.sh#L28

yarn global add expo-cli error https://registry.yarnpkg.com/@expo...traveling-fastlane-linux-1.11.4.tgz: ESOCKETTIMEDOUT

| id: yarn
| version: 0.1.1
| collection: https://github.com/bitrise-io/bitrise-steplib.git
| toolkit: go
| time: 2020-01-21T10:57:39Z

I have tried to add "--registry https://registry.npmjs.org --network-timeout 100000", but still receive error ESOCKETTIMEDOUT

yarn "global" "add" "expo-cli" "turtle-cli" "json" "gulp-cli" "--registry" "https://registry.npmjs.org" "--network-timeout" "100000"

[2/4] Fetching packages...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...
error https://registry.yarnpkg.com/@expo/traveling-fastlane-linux/-/traveling-fastlane-linux-1.11.4.tgz: ESOCKETTIMEDOUT
error https://registry.yarnpkg.com/@expo/traveling-fastlane-darwin/-/traveling-fastlane-darwin-1.11.4.tgz: ESOCKETTIMEDOUT

Also, i have added the script before Yarn global step:
echo "network-timeout 600000" >> .yarnrc

I added wget bash script step - it downloads this package without any erros in 16 seconds:

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.