Skip to content

Commit caa75b6

Browse files
committed
Fixes for npm package and node version incompatibility
* Setting 'ignore-engines=true' prior to invoking vue create. This fixed a problem with some package not ready to deal with the latest version of node. (vuejs/vue-cli#7116)
1 parent 01ecfb8 commit caa75b6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,13 +146,23 @@ endif
146146
$(log)
147147
@mkdir -p $@
148148
$(ECHO) "Installing vue + components. This can take a while..."
149+
# Some package complained about a too new version of node. Hence ask yarn to ignore
150+
# version of node engine while instaling, then restore the value.
151+
yarn config get ignore-engines > /tmp/.yarn.config.get.ignore-engines
152+
yarn config set ignore-engines true
149153
@cd $(match) \
150154
&& vue create \
151155
--no-git \
152156
--merge \
153157
--skipGetStarted \
154158
--preset ../$(ROOTDIR)/templates/vuedefaults.json \
155159
frontend
160+
ignoreengines=$$(</tmp/.yarn.config.get.ignore-engines); \
161+
if [ "$$ignoreengines" = "undefined" ]; then \
162+
yarn config delete ignore-engines; \
163+
else \
164+
yarn config set ignore-engines $$ignoreengines; \
165+
fi
156166

157167
%/.git:
158168
$(log)

0 commit comments

Comments
 (0)