Skip to content

Commit e7e6c16

Browse files
authored
revert(docs): partially revert 326a1d1 (#5095)
We tried to switch from `yarn` to `npm` because `yarn` ignores lockfiles but learned that we missed a few key things. For now, we are reverting docs and a few other changes that suggested using `npm` instead of `yarn` until we fully remove `yarn` from the codebase. t Please enter the commit message for your changes. Lines starting
1 parent 0e1f396 commit e7e6c16

File tree

6 files changed

+41
-35
lines changed

6 files changed

+41
-35
lines changed

.github/ISSUE_TEMPLATE/bug-report.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ body:
5757
id: logs
5858
attributes:
5959
label: Logs
60-
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `npm install -g code-server`).
60+
description: Run code-server with the --verbose flag and then paste any relevant logs from the server, from the browser console and/or the browser network tab. For issues with installation, include installation logs (i.e. output of `yarn global add code-server`).
6161
- type: textarea
6262
attributes:
6363
label: Screenshot/Video

ci/steps/publish-npm.sh

+6-6
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ main() {
5959
# This string is used to determine how we should tag the npm release.
6060
# Environment can be one of three choices:
6161
# "development" - this means we tag with the PR number, allowing
62-
# a developer to install this version with `npm install code-server@<pr-number>`
62+
# a developer to install this version with `yarn add code-server@<pr-number>`
6363
# "staging" - this means we tag with `beta`, allowing
64-
# a developer to install this version with `npm install code-server@beta`
64+
# a developer to install this version with `yarn add code-server@beta`
6565
# "production" - this means we tag with `latest` (default), allowing
66-
# a developer to install this version with `npm install code-server@latest`
66+
# a developer to install this version with `yarn add code-server@latest`
6767
if ! is_env_var_set "NPM_ENVIRONMENT"; then
6868
echo "NPM_ENVIRONMENT is not set. Determining in script based on GITHUB environment variables."
6969

@@ -96,7 +96,7 @@ main() {
9696
if [[ "$NPM_ENVIRONMENT" == "production" ]]; then
9797
NPM_VERSION="$VERSION"
9898
# This means the npm version will be published as "stable"
99-
# and installed when a user runs `npm install code-server`
99+
# and installed when a user runs `yarn install code-server`
100100
NPM_TAG="latest"
101101
else
102102
COMMIT_SHA="$GITHUB_SHA"
@@ -107,7 +107,7 @@ main() {
107107
if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then
108108
NPM_VERSION="$VERSION-beta-$COMMIT_SHA"
109109
# This means the npm version will be tagged with "beta"
110-
# and installed when a user runs `npm install code-server@beta`
110+
# and installed when a user runs `yarn install code-server@beta`
111111
NPM_TAG="beta"
112112
fi
113113

@@ -117,7 +117,7 @@ main() {
117117
NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA"
118118
PACKAGE_NAME="@coder/code-server-pr"
119119
# This means the npm version will be tagged with "<pr number>"
120-
# and installed when a user runs `npm install code-server@<pr number>`
120+
# and installed when a user runs `yarn install code-server@<pr number>`
121121
NPM_TAG="$PR_NUMBER"
122122
fi
123123

docs/android.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
1. Install UserLAnd from [Google Play](https://play.google.com/store/apps/details?id=tech.ula&hl=en_US&gl=US)
44
2. Install an Ubuntu VM
55
3. Start app
6-
4. Install Node.js, `curl` and `npm` using `sudo apt install nodejs npm curl -y`
6+
4. Install Node.js, `curl` and `yarn` using `sudo apt install nodejs npm yarn curl -y`
77
5. Install `nvm`:
88

99
```shell

docs/install.md

+23-15
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- [install.sh](#installsh)
66
- [Detection reference](#detection-reference)
7-
- [npm](#npm)
7+
- [yarn, npm](#yarn-npm)
88
- [Standalone releases](#standalone-releases)
99
- [Debian, Ubuntu](#debian-ubuntu)
1010
- [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse)
@@ -19,7 +19,7 @@
1919
- [Uninstall](#uninstall)
2020
- [install.sh](#installsh-1)
2121
- [Homebrew](#homebrew)
22-
- [npm](#npm-1)
22+
- [yarn, npm](#yarn-npm-1)
2323
- [Debian, Ubuntu](#debian-ubuntu-1)
2424

2525
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
@@ -87,16 +87,17 @@ _exact_ same commands presented in the rest of this document.
8787

8888
- Ensure that you add `~/.local/bin` to your `$PATH` to run code-server.
8989

90-
- For FreeBSD, code-server will install the [npm package](#npm) with `npm`.
90+
- For FreeBSD, code-server will install the [npm package](#yarn-npm) with `yarn`
91+
or `npm`.
9192

9293
- If you're installing code-server onto architecture with no releases,
93-
code-server will install the [npm package](#npm) with `npm`
94+
code-server will install the [npm package](#yarn-npm) with `yarn` or `npm`
9495
- We currently offer releases for amd64 and arm64.
95-
- The [npm package](#npm) builds the native modules on post-install.
96+
- The [npm package](#yarn-npm) builds the native modules on post-install.
9697

97-
## npm
98+
## yarn, npm
9899

99-
We recommend installing with `npm` when:
100+
We recommend installing with `yarn` or `npm` when:
100101

101102
1. You aren't using a machine with `amd64` or `arm64`.
102103
1. You are installing code-server on Windows
@@ -106,17 +107,17 @@ We recommend installing with `npm` when:
106107
[#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198)
107108
for more information.
108109

109-
Installing code-server with `npm` builds native modules on install.
110+
Installing code-server with `yarn` or `npm` builds native modules on install.
110111

111-
This process requires C dependencies; see our guide on [installing with `npm`][./npm.md](./npm.md) for more information.
112+
This process requires C dependencies; see our guide on [installing with yarn and npm][./npm.md](./npm.md) for more information.
112113

113114
## Standalone releases
114115

115116
We publish self-contained `.tar.gz` archives for every release on
116117
[GitHub](https://github.com/coder/code-server/releases). The archives bundle the
117118
node binary and node modules.
118119

119-
We create the standalone releases using the [npm package](#npm), and we
120+
We create the standalone releases using the [npm package](#yarn-npm), and we
120121
then create the remaining releases using the standalone version.
121122

122123
The only requirement to use the standalone release is `glibc` >= 2.17 and
@@ -150,7 +151,7 @@ code-server
150151
## Debian, Ubuntu
151152

152153
> The standalone arm64 .deb does not support Ubuntu 16.04 or earlier. Please
153-
> upgrade or [build with `npm`](#npm).
154+
> upgrade or [build with yarn](#yarn-npm).
154155
155156
```bash
156157
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server_$VERSION_amd64.deb
@@ -162,7 +163,7 @@ sudo systemctl enable --now code-server@$USER
162163
## Fedora, CentOS, RHEL, SUSE
163164

164165
> The standalone arm64 .rpm does not support CentOS 7. Please upgrade or [build
165-
> with `npm`](#npm).
166+
> with yarn](#yarn-npm).
166167
167168
```bash
168169
curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-amd64.rpm
@@ -227,13 +228,14 @@ You can install code-server using the [Helm package manager](https://coder.com/d
227228

228229
## Windows
229230

230-
We currently [do not publish Windows releases](https://github.com/coder/code-server/issues/1397). We recommend installing code-server onto Windows with [`npm`](#npm).
231+
We currently [do not publish Windows releases](https://github.com/coder/code-server/issues/1397). We recommend installing code-server onto Windows with [`yarn` or `npm`](#yarn-npm).
231232

232233
> Note: You will also need to [build coder/cloud-agent manually](https://github.com/coder/cloud-agent/issues/17) if you would like to use `code-server --link` on Windows.
233234
234235
## Raspberry Pi
235236

236-
We recommend installing code-server onto Raspberry Pi with [`npm`](#npm).
237+
We recommend installing code-server onto Raspberry Pi with [`yarn` or
238+
`npm`](#yarn-npm).
237239

238240
## Termux
239241

@@ -275,10 +277,16 @@ brew remove code-server
275277
brew uninstall code-server
276278
```
277279

278-
### npm
280+
### yarn, npm
279281

280282
To remove the code-server global module, run:
281283

284+
```shell
285+
yarn global remove code-server
286+
```
287+
288+
or
289+
282290
```shell
283291
npm uninstall -g code-server
284292
```

docs/manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"children": [
2222
{
2323
"title": "npm",
24-
"description": "How to install code-server using npm",
24+
"description": "How to install code-server using npm or yarn",
2525
"path": "./npm.md"
2626
},
2727
{

docs/npm.md

+9-11
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,6 @@ If you're installing code-server via `npm`, you'll need to install additional
2020
dependencies required to build the native modules used by VS Code. This article
2121
includes installing instructions based on your operating system.
2222

23-
> **WARNING**: Do not use `yarn` to install code-server. Unlike `npm`, it does not respect
24-
> lockfiles for distributed applications. It will instead use the latest version
25-
> available at installation time - which might not be the one used for a given
26-
> code-server release, and [might lead to unexpected behavior](https://github.com/coder/code-server/issues/4927).
27-
2823
## Node.js version
2924

3025
We use the same major version of Node.js shipped with VSCode's Electron,
@@ -77,7 +72,7 @@ Proceed to [installing](#installing)
7772
## FreeBSD
7873

7974
```sh
80-
pkg install -y git python npm-node14 pkgconf
75+
pkg install -y git python npm-node14 yarn-node14 pkgconf
8176
pkg install -y libinotify
8277
```
8378

@@ -90,7 +85,8 @@ Installing code-server requires all of the [prerequisites for VS Code developmen
9085
Next, install code-server with:
9186

9287
```bash
93-
npm install -g code-server
88+
yarn global add code-server
89+
# Or: npm install -g code-server
9490
code-server
9591
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
9692
```
@@ -100,7 +96,8 @@ A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git b
10096
If the `code-server` command is not found, you'll need to [add a directory to your PATH](https://www.architectryan.com/2018/03/17/add-to-the-path-on-windows-10/). To find the directory, use the following command:
10197

10298
```shell
103-
npm config get prefix
99+
yarn global bin
100+
# Or: npm config get prefix
104101
```
105102

106103
For help and additional troubleshooting, see [#1397](https://github.com/coder/code-server/issues/1397).
@@ -110,7 +107,8 @@ For help and additional troubleshooting, see [#1397](https://github.com/coder/co
110107
After adding the dependencies for your OS, install the code-server package globally:
111108

112109
```bash
113-
npm install -g code-server
110+
yarn global add code-server
111+
# Or: npm install -g code-server
114112
code-server
115113
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
116114
```
@@ -124,7 +122,7 @@ page](https://github.com/coder/code-server/discussions).
124122

125123
Occasionally, you may run into issues with Node.js.
126124

127-
If you install code-server using `npm`, and you upgrade your Node.js
125+
If you install code-server using `yarn` or `npm`, and you upgrade your Node.js
128126
version, you may need to reinstall code-server to recompile native modules.
129127
Sometimes, you can get around this by navigating into code-server's `lib/vscode`
130128
directory and running `npm rebuild` to recompile the modules.
@@ -138,7 +136,7 @@ A step-by-step example of how you might do this is:
138136

139137
### Debugging install issues with npm
140138

141-
To debug installation issues:
139+
`yarn` suppresses logs when running `yarn global add`, so to debug installation issues, install with `npm` instead:
142140

143141
```shell
144142
# Uninstall

0 commit comments

Comments
 (0)