Repository: ansible-collections/community.general

Issue:
comunity.general.yarn --no-emoji option causes errors
### Summary

Using community.general.yarn to manage Yarn packages for Yarn Modern (i.e., Yarn versions 2 and above) fails with the following error:

```
fatal: [example.com]: FAILED! => {"changed": false, "cmd": "/usr/bin/yarn install --non-interactive --production --no-emoji", "msg": "", "rc": 1, "stderr": "", "stderr_lines": [], "stdout": "\u001b[31m\u001b[1mUnknown Syntax Error\u001b[22m\u001b[39m: Unsupported option name (\"--no-emoji\").\n\n$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]\n", "stdout_lines": ["\u001b[31m\u001b[1mUnknown Syntax Error\u001b[22m\u001b[39m: Unsupported option name (\"--no-emoji\").", "", "$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]"]}
```

### Issue Type

Bug Report

### Component Name

yarn

### Ansible Version

```console (paste below)
$ ansible --version
ansible [core 2.12.4]
  config file = None
  configured module search path = ['/Users/josh/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /opt/homebrew/Cellar/ansible/5.5.0/libexec/lib/python3.10/site-packages/ansible
  ansible collection location = /Users/josh/.ansible/collections:/usr/share/ansible/collections
  executable location = /opt/homebrew/bin/ansible
  python version = 3.10.2 (main, Feb  2 2022, 05:51:25) [Clang 13.0.0 (clang-1300.0.29.3)]
  jinja version = 3.1.1
  libyaml = True
```


### Community.general Version

```console (paste below)
$ ansible-galaxy collection list community.general


# /opt/homebrew/Cellar/ansible/5.5.0/libexec/lib/python3.10/site-packages/ansible_collections
Collection        Version
----------------- -------
community.general 4.6.0
```


### Configuration

```console (paste below)
$ ansible-config dump --only-changed
DEFAULT_REMOTE_USER(/Users/josh/src/ansible/ansible.cfg) = ubuntu
INTERPRETER_PYTHON(/Users/josh/src/ansible/ansible.cfg) = auto
```


### OS / Environment

Running from macOS, targeting Ubuntu 20.04

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)
    - name: Install NPM packages
      community.general.yarn:
        path: /home/example/deploy
        production: yes
      become: false
```


### Expected Results

Yarn runs successfully.

### Actual Results

```console (paste below)
fatal: [dev.rmonix.net]: FAILED! => {
    "changed": false,
    "cmd": "/usr/bin/yarn install --non-interactive --production --no-emoji",
    "invocation": {
        "module_args": {
            "executable": null,
            "global": false,
            "ignore_scripts": false,
            "name": null,
            "path": "/home/example/deploy",
            "production": true,
            "registry": null,
            "state": "present",
            "version": null
        }
    },
    "msg": "",
    "rc": 1,
    "stderr": "",
    "stderr_lines": [],
    "stdout": "\u001b[31m\u001b[1mUnknown Syntax Error\u001b[22m\u001b[39m: Unsupported option name (\"--no-emoji\").\n\n$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]\n",
    "stdout_lines": [
        "\u001b[31m\u001b[1mUnknown Syntax Error\u001b[22m\u001b[39m: Unsupported option name (\"--no-emoji\").",
        "",
        "$ yarn install [--json] [--immutable] [--immutable-cache] [--check-cache] [--inline-builds] [--mode #0]"
    ]
}
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/packaging/language/yarn.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/packaging/language/yarn.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @chrishoffman @verkaufer
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->

Resolving patch:
diff --git a/plugins/modules/packaging/language/yarn.py b/plugins/modules/packaging/language/yarn.py
--- a/plugins/modules/packaging/language/yarn.py
+++ b/plugins/modules/packaging/language/yarn.py
@@ -147,7 +147,7 @@
             }
         }
 out:
-    description: Output generated from Yarn with emojis removed.
+    description: Output generated from Yarn.
     returned: always
     type: str
     sample: "yarn add v0.16.1[1/4] Resolving packages...[2/4] Fetching packages...[3/4] Linking dependencies...[4/4]
@@ -205,9 +205,6 @@ def _exec(self, args, run_in_check_mode=False, check_rc=True):
                 cmd.append('--registry')
                 cmd.append(self.registry)
 
-            # always run Yarn without emojis when called via Ansible
-            cmd.append('--no-emoji')
-
             # If path is specified, cd into that path and run the command.
             cwd = None
             if self.path and not self.globally:


Test patch: