Skip to content

Commit ffc47d3

Browse files
authored
Merge pull request #4015 from cdr/bpmct/win10-npm
improve npm/yarn install flow and add Windows 10 instructions
2 parents 7cde11e + 60b3323 commit ffc47d3

File tree

2 files changed

+66
-20
lines changed

2 files changed

+66
-20
lines changed

docs/install.md

+11-15
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
- [macOS](#macos)
1313
- [Docker](#docker)
1414
- [Helm](#helm)
15+
- [Windows](#windows)
1516
- [Raspberry Pi](#raspberry-pi)
1617
- [Termux](#termux)
1718
- [Cloud providers](#cloud-providers)
@@ -99,27 +100,16 @@ _exact_ same commands presented in the rest of this document.
99100
We recommend installing with `yarn` or `npm` when:
100101

101102
1. You aren't using a machine with `amd64` or `arm64`.
102-
2. You're on Linux with `glibc` < v2.17, `glibcxx` < v3.4.18 on `amd64`, `glibc`
103+
1. You are installing code-server on Windows
104+
1. You're on Linux with `glibc` < v2.17, `glibcxx` < v3.4.18 on `amd64`, `glibc`
103105
< v2.23, or `glibcxx` < v3.4.21 on `arm64`.
104-
3. You're running Alpine Linux or are using a non-glibc libc. See
106+
1. You're running Alpine Linux or are using a non-glibc libc. See
105107
[#1430](https://github.com/cdr/code-server/issues/1430#issuecomment-629883198)
106108
for more information.
107109

108110
Installing code-server with `yarn` or `npm` builds native modules on install.
109-
This process requires C dependencies; see our guide on [installing these
110-
dependencies][./npm.md](./npm.md) for more information.
111111

112-
You must have Node.js v12 (or later) installed. See
113-
[#1633](https://github.com/cdr/code-server/issues/1633).
114-
115-
To install:
116-
117-
```bash
118-
yarn global add code-server
119-
# Or: npm install -g code-server
120-
code-server
121-
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
122-
```
112+
This process requires C dependencies; see our guide on [installing with yarn and npm][./npm.md](./npm.md) for more information.
123113

124114
## Standalone releases
125115

@@ -236,6 +226,12 @@ alternative](https://hub.docker.com/r/linuxserver/code-server).
236226

237227
You can install code-server via [Helm](https://github.com/cdr/code-server/blob/main/ci/helm-chart/README.md).
238228

229+
## Windows
230+
231+
We currently [do not publish Windows releases](https://github.com/cdr/code-server/issues/1397). We recommend installing code-server onto Windows with [`yarn` or `npm`](#yarn-npm).
232+
233+
> Note: You will also need to [build cdr/cloud-agent manually](https://github.com/cdr/cloud-agent/issues/17) if you would like to use `code-server --link` on Windows.
234+
239235
## Raspberry Pi
240236

241237
We recommend installing code-server onto Raspberry Pi with [`yarn` or

docs/npm.md

+55-5
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88
- [Alpine](#alpine)
99
- [macOS](#macos)
1010
- [FreeBSD](#freebsd)
11-
- [Issues with Node.js after version upgrades](#issues-with-nodejs-after-version-upgrades)
11+
- [Windows](#windows)
12+
- [Installing](#installing)
13+
- [Troubleshooting](#troubleshooting)
14+
- [Issues with Node.js after version upgrades](#issues-with-nodejs-after-version-upgrades)
1215

1316
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
1417

@@ -35,6 +38,8 @@ sudo apt-get install -y \
3538
npm config set python python3
3639
```
3740

41+
Proceed to [installing](#installing)
42+
3843
## Fedora, CentOS, RHEL
3944

4045
```bash
@@ -44,27 +49,75 @@ sudo yum install -y python2
4449
npm config set python python2
4550
```
4651

52+
Proceed to [installing](#installing)
53+
4754
## Alpine
4855

4956
```bash
5057
apk add alpine-sdk bash libstdc++ libc6-compat
5158
npm config set python python3
5259
```
5360

61+
Proceed to [installing](#installing)
62+
5463
## macOS
5564

5665
```bash
5766
xcode-select --install
5867
```
5968

69+
Proceed to [installing](#installing)
70+
6071
## FreeBSD
6172

6273
```sh
6374
pkg install -y git python npm-node14 yarn-node14 pkgconf
6475
pkg install -y libinotify
6576
```
6677

67-
## Issues with Node.js after version upgrades
78+
Proceed to [installing](#installing)
79+
80+
## Windows
81+
82+
Installing code-server requires all of the [prerequisites for VS Code development](https://github.com/Microsoft/vscode/wiki/How-to-Contribute#prerequisites). When installing the C++ compiler tool chain, we recommend using "Option 2: Visual Studio 2019" for best results.
83+
84+
Next, install code-server with:
85+
86+
```bash
87+
yarn global add code-server
88+
# Or: npm install -g code-server
89+
code-server
90+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
91+
```
92+
93+
A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git bash) as the default application for `.sh` files. If an additional dialog does not appear, run the install command again.
94+
95+
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:
96+
97+
```shell
98+
yarn global bin
99+
# Or: npm config get prefix
100+
```
101+
102+
For help and additional troubleshooting, see [#1397](https://github.com/cdr/code-server/issues/1397).
103+
104+
## Installing
105+
106+
After adding the dependencies for your OS, install the code-server package globally:
107+
108+
```bash
109+
yarn global add code-server
110+
# Or: npm install -g code-server
111+
code-server
112+
# Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
113+
```
114+
115+
## Troubleshooting
116+
117+
If you need further assistance, post on our [GitHub Discussions
118+
page](https://github.com/cdr/code-server/discussions).
119+
120+
### Issues with Node.js after version upgrades
68121

69122
Occasionally, you may run into issues with Node.js.
70123

@@ -79,6 +132,3 @@ A step-by-step example of how you might do this is:
79132
2. Navigate into the directory: `cd /usr/local/Cellar/code-server/<version>/libexec/lib/vscode/`
80133
3. Recompile the native modules: `npm rebuild`
81134
4. Restart code-server
82-
83-
If you need further assistance, post on our [GitHub Discussions
84-
page](https://github.com/cdr/code-server/discussions).

0 commit comments

Comments
 (0)