@@ -25,6 +25,10 @@ DEFAULT_SWIFT_VERSION="5.4"
25
25
# PHP version
26
26
DEFAULT_PHP_VERSION=" 8.0"
27
27
28
+ # Internal yarn config
29
+ # We use an "internal" yarn v1 executable as to not be impacted by corepack yarn selection
30
+ INTERNAL_YARN_PATH=" $HOME /.yarn/bin"
31
+
28
32
# Pipenv configuration
29
33
export PIPENV_RUNTIME=3.8
30
34
export PIPENV_VENV_IN_PROJECT=1
@@ -107,7 +111,7 @@ restore_node_modules() {
107
111
# YARN_IGNORE_PATH will ignore the presence of a local yarn executable (i.e. yarn 2) and default
108
112
# to using the global one (which, for now, is always yarn 1.x). See https://yarnpkg.com/configuration/yarnrc#ignorePath
109
113
# we can actually use this command for npm workspaces as well
110
- workspace_output=" $( YARN_IGNORE_PATH=1 yarn workspaces --json info 2> /dev/null) "
114
+ workspace_output=" $( YARN_IGNORE_PATH=1 " $INTERNAL_YARN_PATH / yarn" workspaces --json info 2> /dev/null) "
111
115
workspace_exit_code=$?
112
116
if [ $workspace_exit_code -eq 0 ]
113
117
then
@@ -137,6 +141,10 @@ run_yarn() {
137
141
restore_home_cache " .yarn_cache" " yarn cache"
138
142
139
143
if ! [ $( which corepack) ] || has_feature_flag " $featureFlags " " build-image-disable-node-corepack" ; then
144
+
145
+ # We manually add our internal yarn version to our path as a fallback, as this means the customer won't have a default
146
+ # yarn version installed
147
+ export PATH=$INTERNAL_YARN_PATH :$PATH
140
148
if [ -d $NETLIFY_CACHE_DIR /yarn ]
141
149
then
142
150
export PATH=$NETLIFY_CACHE_DIR /yarn/bin:$PATH
0 commit comments