code-server
code-server copied to clipboard
`install.sh` fails with npm when YARN_PATH environment variable is not defined
Installation of code-server via install.sh fails on docker images.
https://github.com/coder/code-server/blob/ad81a30db5421fcfe66b53e61a50b38f1a7f3cc1/install.sh#L422-L423
Steps to Reproduce
$ docker run -it alpine
/ # apk add nodejs npm curl
...
/ # node -v
v14.18.1
/ # npm -v
7.17.0
/ # curl -fsSL https://code-server.dev/install.sh | sh
Alpine Linux v3.14
Installing latest from npm.
Please install npm or yarn to install code-server!
You will need at least node v12 and a few C dependencies.
See the docs https://coder.com/docs/code-server/latest/install#yarn-npm
/ #
Expected
Code-server should get installed.
Actual
Installation fails and I get the following output:
# printenv
418 install_npm() {
419 echoh "Installing latest from npm."
420 echoh
421
422 YARN_PATH="${YARN_PATH-yarn}"
423 NPM_PATH="${YARN_PATH-npm}"
424
425 echoh YARN_PATH=$YARN_PATH
426 echoh NPM_PATH=$NPM_PATH
/ # sh ./install.sh
Alpine Linux v3.14
Installing latest from npm.
YARN_PATH=yarn
NPM_PATH=yarn
Please install npm or yarn to install code-server!
You will need at least node v12 and a few C dependencies.
See the docs https://coder.com/docs/code-server/latest/install#yarn-npm
/ #
Weird. This is unexpected. Thanks for the detailed report. If npm is installed, we should be using that to install code-server, not erroring if yarn isn't available.
cc @code-asher (thought you would find this interesting).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no activity occurs in the next 5 days.