提交 a3bea6c6 编写于 作者: K Katie Horne

Update install, npm package install instructions

上级 c817f871
...@@ -72,7 +72,7 @@ During the code-server installation process, the following packages will be inst ...@@ -72,7 +72,7 @@ During the code-server installation process, the following packages will be inst
- For any unrecognized Linux operating system, code-server installs the latest standalone release into `~/.local`. Make sure that you add `~/.local/bin` to your `$PATH` to run code-server. - For any unrecognized Linux operating system, code-server installs the latest standalone release into `~/.local`. Make sure that you add `~/.local/bin` to your `$PATH` to run code-server.
- For macOS code-server installs Homebrew to `~/.local`. Make sure that you add `~/.local/bin` to your `$PATH` to run code-server. - For macOS code-server installs Homebrew to `~/.local`. Make sure that you add `~/.local/bin` to your `$PATH` to run code-server.
- For FreeBSD, code-server installs the [npm package](#yarn-npm) with `yarn` or `npm` - For FreeBSD, code-server installs the [npm package](#yarn-npm) with `yarn` or `npm`
- If you run code-server on an architecture with no releases, it installs the [npm package](#yarn-npm) with `yarn` or `npm`. The [npm package](#yarn-npm) builds the native modules on postinstall. Please note that we currently have releases only for amd64 and arm64. - If you run code-server on an architecture with no releases, it installs the [npm package](#yarn-npm) with `yarn` or `npm`. The [npm package](#yarn-npm) builds the native modules on postinstall. Please note that we currently have releases only for **amd64** and **arm64**.
### Debian, Ubuntu ### Debian, Ubuntu
...@@ -90,8 +90,7 @@ sudo systemctl enable --now code-server@$USER ...@@ -90,8 +90,7 @@ sudo systemctl enable --now code-server@$USER
curl -fOL https://github.com/cdr/code-server/releases/download/v3.5.0/code-server-3.5.0-amd64.rpm curl -fOL https://github.com/cdr/code-server/releases/download/v3.5.0/code-server-3.5.0-amd64.rpm
sudo rpm -i code-server-3.5.0-amd64.rpm sudo rpm -i code-server-3.5.0-amd64.rpm
sudo systemctl enable --now code-server@$USER sudo systemctl enable --now code-server@$USER
# Now visit http://127.0.0.1:8080. # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Your password is in ~/.config/code-server/config.yaml
``` ```
### Arch Linux ### Arch Linux
...@@ -102,8 +101,7 @@ To install code-server onto a workstation running Arch Linux using [yay](https:/ ...@@ -102,8 +101,7 @@ To install code-server onto a workstation running Arch Linux using [yay](https:/
# Installs code-server from the AUR using yay. # Installs code-server from the AUR using yay.
yay -S code-server yay -S code-server
sudo systemctl enable --now code-server@$USER sudo systemctl enable --now code-server@$USER
# Now visit http://127.0.0.1:8080. # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Your password is in ~/.config/code-server/config.yaml
``` ```
Alternatively, you can use [makepkg](https://wiki.archlinux.org/index.php/Makepkg): Alternatively, you can use [makepkg](https://wiki.archlinux.org/index.php/Makepkg):
...@@ -114,8 +112,7 @@ git clone https://aur.archlinux.org/code-server.git ...@@ -114,8 +112,7 @@ git clone https://aur.archlinux.org/code-server.git
cd code-server cd code-server
makepkg -si makepkg -si
sudo systemctl enable --now code-server@$USER sudo systemctl enable --now code-server@$USER
# Now visit http://127.0.0.1:8080. # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Your password is in ~/.config/code-server/config.yaml
``` ```
### macOS ### macOS
...@@ -123,8 +120,7 @@ sudo systemctl enable --now code-server@$USER ...@@ -123,8 +120,7 @@ sudo systemctl enable --now code-server@$USER
```bash ```bash
brew install code-server brew install code-server
brew services start code-server brew services start code-server
# Now visit http://127.0.0.1:8080. # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Your password is in ~/.config/code-server/config.yaml
``` ```
### yarn, npm ### yarn, npm
...@@ -136,8 +132,9 @@ You can install code-server using Yarn or npm. We recommend doing so if: ...@@ -136,8 +132,9 @@ You can install code-server using Yarn or npm. We recommend doing so if:
Notes: Notes:
- Installing code-server using Yarn or npm builds native modules on install, which requires [C dependencies](./npm.md) for installing these dependencies - Installing code-server using Yarn or npm builds native modules on install, which requires [C dependencies](./npm.md) for install
- You must have Node.js version 12.x (or greater) installed - You must have Node.js version 12.x (or greater) installed
- If you're running macOS, install [Xcode](https://developer.apple.com/xcode/downloads/) and run `xcode-select --install` befor proceeding with the installation.
To install code-server using Yarn/npm: To install code-server using Yarn/npm:
...@@ -145,15 +142,14 @@ To install code-server using Yarn/npm: ...@@ -145,15 +142,14 @@ To install code-server using Yarn/npm:
yarn global add code-server yarn global add code-server
# Or: npm install -g code-server # Or: npm install -g code-server
code-server code-server
# Now visit http://127.0.0.1:8080. # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Your password is in ~/.config/code-server/config.yaml
``` ```
## Standalone Releases ## Standalone Releases
For every release, we publish [self-contained .tar.gz archives](https://github.com/cdr/code-server/releases) that bundle the Node binary and modules. For every release, we publish [self-contained .tar.gz archives](https://github.com/cdr/code-server/releases) that bundle the Node binary and modules.
The base for these were created from the [npm package](#yarn-npm) with all subsequent releases created from the base. The base for these were created from the [npm package](#yarn-npm); we've created all subsequent releases using this base.
### Requirements ### Requirements
...@@ -169,7 +165,7 @@ There are no minimum system requirements for macOS. ...@@ -169,7 +165,7 @@ There are no minimum system requirements for macOS.
To use code-server, point your browser to **http://127.0.0.1:8080**. You can find your password in **~/.config/code-server/config.yaml**. To use code-server, point your browser to **http://127.0.0.1:8080**. You can find your password in **~/.config/code-server/config.yaml**.
To run code-server without providing the full path, add the code-server `bin` directory to your `$PATH`. If you'd like to run code-server without providing the full path, add the code-server `bin` directory to your `$PATH`.
### Sample Installation Script ### Sample Installation Script
...@@ -183,8 +179,7 @@ mv ~/.local/lib/code-server-3.5.0-linux-amd64 ~/.local/lib/code-server-3.5.0 ...@@ -183,8 +179,7 @@ mv ~/.local/lib/code-server-3.5.0-linux-amd64 ~/.local/lib/code-server-3.5.0
ln -s ~/.local/lib/code-server-3.5.0/bin/code-server ~/.local/bin/code-server ln -s ~/.local/lib/code-server-3.5.0/bin/code-server ~/.local/bin/code-server
PATH="~/.local/bin:$PATH" PATH="~/.local/bin:$PATH"
code-server code-server
# Now visit http://127.0.0.1:8080. # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml
# Your password is in ~/.config/code-server/config.yaml
``` ```
### Docker ### Docker
...@@ -215,4 +210,4 @@ docker run -it -p 127.0.0.1:8080:8080 \ ...@@ -215,4 +210,4 @@ docker run -it -p 127.0.0.1:8080:8080 \
## Alternatives ## Alternatives
Our official code-server image supports `amd64` and `arm64` architectures, but if you're using `arm32`, there is a [community-maintained alternative](https://hub.docker.com/r/linuxserver/code-server) Our official code-server image supports `amd64` and `arm64` architectures, but if you're using `arm32`, there is a [community-maintained alternative](https://hub.docker.com/r/linuxserver/code-server)
\ No newline at end of file
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
# npm Install Requirements # npm Package Installation Requirements
- [Ubuntu, Debian](#ubuntu-debian) - [npm Package Installation Requirements](#npm-package-installation-requirements)
- [Fedora, CentOS, RHEL](#fedora-centos-rhel) - [Debian, Ubuntu](#debian-ubuntu)
- [macOS](#macos) - [CentOS, Fedora, RHEL](#centos-fedora-rhel)
<!-- END doctoc generated TOC please keep comment here to allow auto update --> <!-- END doctoc generated TOC please keep comment here to allow auto update -->
If you're installing the npm module you'll need certain dependencies to build This article shows you how to install the npm package required when [installing code-server](./install.md#yarn-npm) onto a machine with architecture for which we don't offer a designated release. The npm package builds the native modules used by VS Code.
the native modules used by VS Code.
You also need at least node v12 installed. See [#1633](https://github.com/cdr/code-server/issues/1633). Before proceeding, please make sure that you have Node.js version 12.x (or later) installed.
## Ubuntu, Debian ## Debian, Ubuntu
To install the npm package on a machine running Debian or Ubuntu:
```bash ```bash
sudo apt-get install -y \ sudo apt-get install -y \
...@@ -26,7 +27,9 @@ sudo apt-get install -y \ ...@@ -26,7 +27,9 @@ sudo apt-get install -y \
npm config set python python3 npm config set python python3
``` ```
## Fedora, CentOS, RHEL ## CentOS, Fedora, RHEL
To install the npm package on a machine running CentOS, Fedora, or RHEL:
```bash ```bash
sudo yum groupinstall -y 'Development Tools' sudo yum groupinstall -y 'Development Tools'
...@@ -34,11 +37,3 @@ sudo yum config-manager --set-enabled PowerTools # unnecessary on CentOS 7 ...@@ -34,11 +37,3 @@ sudo yum config-manager --set-enabled PowerTools # unnecessary on CentOS 7
sudo yum install -y python2 libsecret-devel libX11-devel libxkbfile-devel sudo yum install -y python2 libsecret-devel libX11-devel libxkbfile-devel
npm config set python python2 npm config set python python2
``` ```
## macOS
Install [Xcode](https://developer.apple.com/xcode/downloads/) and run:
```bash
xcode-select --install
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册