diff --git a/bundles/element-web/items.py b/bundles/element-web/items.py index bbd7622..cb21f61 100644 --- a/bundles/element-web/items.py +++ b/bundles/element-web/items.py @@ -29,9 +29,8 @@ actions = { 'element-web_yarn': { 'command': ' && '.join([ 'cd /opt/element-web', - 'npm install yarn', - 'node_modules/yarn/bin/yarn install --pure-lockfile --ignore-scripts', - 'node_modules/yarn/bin/yarn build', + 'yarn install --pure-lockfile --ignore-scripts', + 'yarn build', ]), 'needs': { 'pkg_apt:nodejs', diff --git a/bundles/hedgedoc/items.py b/bundles/hedgedoc/items.py index c7d329e..ed679bd 100644 --- a/bundles/hedgedoc/items.py +++ b/bundles/hedgedoc/items.py @@ -55,10 +55,9 @@ actions = { 'hedgedoc_yarn': { 'command': ' && '.join([ 'cd /opt/hedgedoc', - 'npm install yarn', - 'node_modules/yarn/bin/yarn install --production=true --pure-lockfile --ignore-scripts', - 'node_modules/yarn/bin/yarn install --ignore-scripts', - 'node_modules/yarn/bin/yarn build', + 'yarn install --production=true --pure-lockfile --ignore-scripts', + 'yarn install --ignore-scripts', + 'yarn build', ]), 'needs': { 'file:/opt/hedgedoc/config.json', diff --git a/bundles/nodejs/items.py b/bundles/nodejs/items.py new file mode 100644 index 0000000..dc8607c --- /dev/null +++ b/bundles/nodejs/items.py @@ -0,0 +1,9 @@ +actions = { + 'nodejs_install_yarn': { + 'command': 'npm install -g yarn@latest', + 'unless': 'test -e /usr/lib/node_modules/yarn', + 'needs': { + 'pkg_apt:nodejs', + }, + }, +} diff --git a/bundles/nodejs/metadata.py b/bundles/nodejs/metadata.py index e1b90cf..288fdc6 100644 --- a/bundles/nodejs/metadata.py +++ b/bundles/nodejs/metadata.py @@ -3,6 +3,7 @@ defaults = { 'additional_update_commands': { # update npm to latest version 'npm install -g npm@latest', + 'npm install -g yarn@latest', }, 'repos': { 'node': { diff --git a/bundles/powerdnsadmin/items.py b/bundles/powerdnsadmin/items.py index fa670d1..1d9dfc1 100644 --- a/bundles/powerdnsadmin/items.py +++ b/bundles/powerdnsadmin/items.py @@ -59,8 +59,7 @@ actions = { 'triggered': True, 'command': ' && '.join([ 'cd /opt/powerdnsadmin/src', - 'npm install yarn', - 'node_modules/yarn/bin/yarn install --pure-lockfile --ignore-scripts', + 'yarn install --pure-lockfile --ignore-scripts', 'FLASK_APP=/opt/powerdnsadmin/src/powerdnsadmin/__init__.py /opt/powerdnsadmin/venv/bin/flask assets build', 'chown -R powerdnsadmin:powerdnsadmin /opt/powerdnsadmin/src/powerdnsadmin/static/', ]),