Skip to content

Commit 62bf7c8

Browse files
committed
refactor: default to npm in postinstall.sh
yarn has a bug where it will try to update dependencies even if `yarn.lock` is present. Therefore we're defaulting to `npm` to prevent further issues.
1 parent 1484bee commit 62bf7c8

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ci/build/npm-postinstall.sh

+8-8
Original file line numberDiff line numberDiff line change
@@ -127,14 +127,6 @@ install_with_yarn_or_npm() {
127127
# NOTE@edvincent: We want to keep using the package manager that the end-user was using to install the package.
128128
# This also ensures that when *we* run `yarn` in the development process, the yarn.lock file is used.
129129
case "${npm_config_user_agent-}" in
130-
yarn*)
131-
if [ -f "yarn.lock" ]; then
132-
yarn --production --frozen-lockfile --no-default-rc
133-
else
134-
echo "yarn.lock file not present, not running in development mode. use npm to install code-server!"
135-
exit 1
136-
fi
137-
;;
138130
npm*)
139131
if [ -f "yarn.lock" ]; then
140132
echo "yarn.lock file present, running in development mode. use yarn to install code-server!"
@@ -146,6 +138,14 @@ install_with_yarn_or_npm() {
146138
npm install --unsafe-perm --legacy-peer-deps --omit=dev
147139
fi
148140
;;
141+
yarn*)
142+
if [ -f "yarn.lock" ]; then
143+
yarn --production --frozen-lockfile --no-default-rc
144+
else
145+
echo "yarn.lock file not present, not running in development mode. use npm to install code-server!"
146+
exit 1
147+
fi
148+
;;
149149
*)
150150
echo "Could not determine which package manager is being used to install code-server"
151151
exit 1

0 commit comments

Comments
 (0)