| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -57,7 +57,7 @@ body: | |||
| 57 | 57 | id: logs | |
| 58 | 58 | attributes: | |
| 59 | 59 | 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 `yarn global add 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 `npm install -g code-server`). | ||
| 61 | 61 | - type: textarea | |
| 62 | 62 | attributes: | |
| 63 | 63 | label: Screenshot/Video | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,6 +55,17 @@ bundle_code_server() { | |||
| 55 | 55 | EOF | |
| 56 | 56 | ) > "$RELEASE_PATH/package.json" | |
| 57 | 57 | rsync yarn.lock "$RELEASE_PATH" | |
| 58 | + | ||
| 59 | + # To ensure deterministic dependency versions (even when code-server is installed with NPM), we seed | ||
| 60 | + # an npm-shrinkwrap file from our yarn lockfile and the current node-modules installed. | ||
| 61 | + synp --source-file yarn.lock | ||
| 62 | + npm shrinkwrap | ||
| 63 | + # HACK: The shrinkwrap file will contain the devDependencies, which by default | ||
| 64 | + # are installed if present in a lockfile. To avoid every user having to specify --production | ||
| 65 | + # to skip them, we carefully remove them from the shrinkwrap file. | ||
| 66 | + json -f npm-shrinkwrap.json -I -e "Object.keys(this.dependencies).forEach(dependency => { if (this.dependencies[dependency].dev) { delete this.dependencies[dependency] } } )" | ||
| 67 | + mv npm-shrinkwrap.json "$RELEASE_PATH" | ||
| 68 | + | ||
| 58 | 69 | rsync ci/build/npm-postinstall.sh "$RELEASE_PATH/postinstall.sh" | |
| 59 | 70 | ||
| 60 | 71 | if [ "$KEEP_MODULES" = 1 ]; then | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,11 +59,11 @@ main() { | |||
| 59 | 59 | # This string is used to determine how we should tag the npm release. | |
| 60 | 60 | # Environment can be one of three choices: | |
| 61 | 61 | # "development" - this means we tag with the PR number, allowing | |
| 62 | - # a developer to install this version with `yarn add code-server@<pr-number>` | ||
| 62 | + # a developer to install this version with `npm install code-server@<pr-number>` | ||
| 63 | 63 | # "staging" - this means we tag with `beta`, allowing | |
| 64 | - # a developer to install this version with `yarn add code-server@beta` | ||
| 64 | + # a developer to install this version with `npm install code-server@beta` | ||
| 65 | 65 | # "production" - this means we tag with `latest` (default), allowing | |
| 66 | - # a developer to install this version with `yarn add code-server@latest` | ||
| 66 | + # a developer to install this version with `npm install code-server@latest` | ||
| 67 | 67 | if ! is_env_var_set "NPM_ENVIRONMENT"; then | |
| 68 | 68 | echo "NPM_ENVIRONMENT is not set. Determining in script based on GITHUB environment variables." | |
| 69 | 69 | ||
@@ -96,7 +96,7 @@ main() { | |||
| 96 | 96 | if [[ "$NPM_ENVIRONMENT" == "production" ]]; then | |
| 97 | 97 | NPM_VERSION="$VERSION" | |
| 98 | 98 | # This means the npm version will be published as "stable" | |
| 99 | - # and installed when a user runs `yarn install code-server` | ||
| 99 | + # and installed when a user runs `npm install code-server` | ||
| 100 | 100 | NPM_TAG="latest" | |
| 101 | 101 | else | |
| 102 | 102 | COMMIT_SHA="$GITHUB_SHA" | |
@@ -107,7 +107,7 @@ main() { | |||
| 107 | 107 | if [[ "$NPM_ENVIRONMENT" == "staging" ]]; then | |
| 108 | 108 | NPM_VERSION="$VERSION-beta-$COMMIT_SHA" | |
| 109 | 109 | # This means the npm version will be tagged with "beta" | |
| 110 | - # and installed when a user runs `yarn install code-server@beta` | ||
| 110 | + # and installed when a user runs `npm install code-server@beta` | ||
| 111 | 111 | NPM_TAG="beta" | |
| 112 | 112 | fi | |
| 113 | 113 | ||
@@ -117,7 +117,7 @@ main() { | |||
| 117 | 117 | NPM_VERSION="$VERSION-$PR_NUMBER-$COMMIT_SHA" | |
| 118 | 118 | PACKAGE_NAME="@coder/code-server-pr" | |
| 119 | 119 | # This means the npm version will be tagged with "<pr number>" | |
| 120 | - # and installed when a user runs `yarn install code-server@<pr number>` | ||
| 120 | + # and installed when a user runs `npm install code-server@<pr number>` | ||
| 121 | 121 | NPM_TAG="$PR_NUMBER" | |
| 122 | 122 | fi | |
| 123 | 123 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ | |||
| 3 | 3 | 1. Install UserLAnd from [Google Play](https://play.google.com/store/apps/details?id=tech.ula&hl=en_US&gl=US) | |
| 4 | 4 | 2. Install an Ubuntu VM | |
| 5 | 5 | 3. Start app | |
| 6 | - 4. Install Node.js, `curl` and `yarn` using `sudo apt install nodejs npm yarn curl -y` | ||
| 6 | + 4. Install Node.js, `curl` and `npm` using `sudo apt install nodejs npm curl -y` | ||
| 7 | 7 | 5. Install `nvm`: | |
| 8 | 8 | ||
| 9 | 9 | ```shell | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -4,7 +4,7 @@ | |||
| 4 | 4 | ||
| 5 | 5 | - [install.sh](#installsh) | |
| 6 | 6 | - [Detection reference](#detection-reference) | |
| 7 | - - [yarn, npm](#yarn-npm) | ||
| 7 | + - [npm](#npm) | ||
| 8 | 8 | - [Standalone releases](#standalone-releases) | |
| 9 | 9 | - [Debian, Ubuntu](#debian-ubuntu) | |
| 10 | 10 | - [Fedora, CentOS, RHEL, SUSE](#fedora-centos-rhel-suse) | |
@@ -19,7 +19,7 @@ | |||
| 19 | 19 | - [Uninstall](#uninstall) | |
| 20 | 20 | - [install.sh](#installsh-1) | |
| 21 | 21 | - [Homebrew](#homebrew) | |
| 22 | - - [yarn, npm](#yarn-npm-1) | ||
| 22 | + - [npm](#npm-1) | ||
| 23 | 23 | - [Debian, Ubuntu](#debian-ubuntu-1) | |
| 24 | 24 | ||
| 25 | 25 | <!-- END doctoc generated TOC please keep comment here to allow auto update --> | |
@@ -87,17 +87,16 @@ _exact_ same commands presented in the rest of this document. | |||
| 87 | 87 | ||
| 88 | 88 | - Ensure that you add `~/.local/bin` to your `$PATH` to run code-server. | |
| 89 | 89 | ||
| 90 | - - For FreeBSD, code-server will install the [npm package](#yarn-npm) with `yarn` | ||
| 91 | - or `npm`. | ||
| 90 | + - For FreeBSD, code-server will install the [npm package](#npm) with `npm`. | ||
| 92 | 91 | ||
| 93 | 92 | - If you're installing code-server onto architecture with no releases, | |
| 94 | - code-server will install the [npm package](#yarn-npm) with `yarn` or `npm` | ||
| 93 | + code-server will install the [npm package](#npm) with `npm` | ||
| 95 | 94 | - We currently offer releases for amd64 and arm64. | |
| 96 | - - The [npm package](#yarn-npm) builds the native modules on post-install. | ||
| 95 | + - The [npm package](#npm) builds the native modules on post-install. | ||
| 97 | 96 | ||
| 98 | - ## yarn, npm | ||
| 97 | + ## npm | ||
| 99 | 98 | ||
| 100 | - We recommend installing with `yarn` or `npm` when: | ||
| 99 | + We recommend installing with `npm` when: | ||
| 101 | 100 | ||
| 102 | 101 | 1. You aren't using a machine with `amd64` or `arm64`. | |
| 103 | 102 | 1. You are installing code-server on Windows | |
@@ -107,17 +106,17 @@ We recommend installing with `yarn` or `npm` when: | |||
| 107 | 106 | [#1430](https://github.com/coder/code-server/issues/1430#issuecomment-629883198) | |
| 108 | 107 | for more information. | |
| 109 | 108 | ||
| 110 | - Installing code-server with `yarn` or `npm` builds native modules on install. | ||
| 109 | + Installing code-server with `npm` builds native modules on install. | ||
| 111 | 110 | ||
| 112 | - This process requires C dependencies; see our guide on [installing with yarn and npm][./npm.md](./npm.md) for more information. | ||
| 111 | + This process requires C dependencies; see our guide on [installing with `npm`][./npm.md](./npm.md) for more information. | ||
| 113 | 112 | ||
| 114 | 113 | ## Standalone releases | |
| 115 | 114 | ||
| 116 | 115 | We publish self-contained `.tar.gz` archives for every release on | |
| 117 | 116 | [GitHub](https://github.com/coder/code-server/releases). The archives bundle the | |
| 118 | 117 | node binary and node modules. | |
| 119 | 118 | ||
| 120 | - We create the standalone releases using the [npm package](#yarn-npm), and we | ||
| 119 | + We create the standalone releases using the [npm package](#npm), and we | ||
| 121 | 120 | then create the remaining releases using the standalone version. | |
| 122 | 121 | ||
| 123 | 122 | The only requirement to use the standalone release is `glibc` >= 2.17 and | |
@@ -151,7 +150,7 @@ code-server | |||
| 151 | 150 | ## Debian, Ubuntu | |
| 152 | 151 | ||
| 153 | 152 | > The standalone arm64 .deb does not support Ubuntu 16.04 or earlier. Please | |
| 154 | - > upgrade or [build with yarn](#yarn-npm). | ||
| 153 | + > upgrade or [build with `npm`](#npm). | ||
| 155 | 154 | ||
| 156 | 155 | ```bash | |
| 157 | 156 | curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server_$VERSION_amd64.deb | |
@@ -163,7 +162,7 @@ sudo systemctl enable --now code-server@$USER | |||
| 163 | 162 | ## Fedora, CentOS, RHEL, SUSE | |
| 164 | 163 | ||
| 165 | 164 | > The standalone arm64 .rpm does not support CentOS 7. Please upgrade or [build | |
| 166 | - > with yarn](#yarn-npm). | ||
| 165 | + > with `npm`](#npm). | ||
| 167 | 166 | ||
| 168 | 167 | ```bash | |
| 169 | 168 | curl -fOL https://github.com/coder/code-server/releases/download/v$VERSION/code-server-$VERSION-amd64.rpm | |
@@ -228,14 +227,13 @@ You can install code-server using the [Helm package manager](https://coder.com/d | |||
| 228 | 227 | ||
| 229 | 228 | ## Windows | |
| 230 | 229 | ||
| 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). | ||
| 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). | ||
| 232 | 231 | ||
| 233 | 232 | > 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. | |
| 234 | 233 | ||
| 235 | 234 | ## Raspberry Pi | |
| 236 | 235 | ||
| 237 | - We recommend installing code-server onto Raspberry Pi with [`yarn` or | ||
| 238 | - `npm`](#yarn-npm). | ||
| 236 | + We recommend installing code-server onto Raspberry Pi with [`npm`](#npm). | ||
| 239 | 237 | ||
| 240 | 238 | ## Termux | |
| 241 | 239 | ||
@@ -277,16 +275,10 @@ brew remove code-server | |||
| 277 | 275 | brew uninstall code-server | |
| 278 | 276 | ``` | |
| 279 | 277 | ||
| 280 | - ### yarn, npm | ||
| 278 | + ### npm | ||
| 281 | 279 | ||
| 282 | 280 | To remove the code-server global module, run: | |
| 283 | 281 | ||
| 284 | - ```shell | ||
| 285 | - yarn global remove code-server | ||
| 286 | - ``` | ||
| 287 | - | ||
| 288 | - or | ||
| 289 | - | ||
| 290 | 282 | ```shell | |
| 291 | 283 | npm uninstall -g code-server | |
| 292 | 284 | ``` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ | |||
| 21 | 21 | "children": [ | |
| 22 | 22 | { | |
| 23 | 23 | "title": "npm", | |
| 24 | - "description": "How to install code-server using npm or yarn", | ||
| 24 | + "description": "How to install code-server using npm", | ||
| 25 | 25 | "path": "./npm.md" | |
| 26 | 26 | }, | |
| 27 | 27 | { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,6 +20,11 @@ If you're installing code-server via `npm`, you'll need to install additional | |||
| 20 | 20 | dependencies required to build the native modules used by VS Code. This article | |
| 21 | 21 | includes installing instructions based on your operating system. | |
| 22 | 22 | ||
| 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 | + | ||
| 23 | 28 | ## Node.js version | |
| 24 | 29 | ||
| 25 | 30 | We use the same major version of Node.js shipped with VSCode's Electron, | |
@@ -72,7 +77,7 @@ Proceed to [installing](#installing) | |||
| 72 | 77 | ## FreeBSD | |
| 73 | 78 | ||
| 74 | 79 | ```sh | |
| 75 | - pkg install -y git python npm-node14 yarn-node14 pkgconf | ||
| 80 | + pkg install -y git python npm-node14 pkgconf | ||
| 76 | 81 | pkg install -y libinotify | |
| 77 | 82 | ``` | |
| 78 | 83 | ||
@@ -85,8 +90,7 @@ Installing code-server requires all of the [prerequisites for VS Code developmen | |||
| 85 | 90 | Next, install code-server with: | |
| 86 | 91 | ||
| 87 | 92 | ```bash | |
| 88 | - yarn global add code-server | ||
| 89 | - # Or: npm install -g code-server | ||
| 93 | + npm install -g code-server | ||
| 90 | 94 | code-server | |
| 91 | 95 | # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml | |
| 92 | 96 | ``` | |
@@ -96,8 +100,7 @@ A `postinstall.sh` script will attempt to run. Select your terminal (e.g., Git b | |||
| 96 | 100 | 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: | |
| 97 | 101 | ||
| 98 | 102 | ```shell | |
| 99 | - yarn global bin | ||
| 100 | - # Or: npm config get prefix | ||
| 103 | + npm config get prefix | ||
| 101 | 104 | ``` | |
| 102 | 105 | ||
| 103 | 106 | For help and additional troubleshooting, see [#1397](https://github.com/coder/code-server/issues/1397). | |
@@ -107,8 +110,7 @@ For help and additional troubleshooting, see [#1397](https://github.com/coder/co | |||
| 107 | 110 | After adding the dependencies for your OS, install the code-server package globally: | |
| 108 | 111 | ||
| 109 | 112 | ```bash | |
| 110 | - yarn global add code-server | ||
| 111 | - # Or: npm install -g code-server | ||
| 113 | + npm install -g code-server | ||
| 112 | 114 | code-server | |
| 113 | 115 | # Now visit http://127.0.0.1:8080. Your password is in ~/.config/code-server/config.yaml | |
| 114 | 116 | ``` | |
@@ -122,7 +124,7 @@ page](https://github.com/coder/code-server/discussions). | |||
| 122 | 124 | ||
| 123 | 125 | Occasionally, you may run into issues with Node.js. | |
| 124 | 126 | ||
| 125 | - If you install code-server using `yarn` or `npm`, and you upgrade your Node.js | ||
| 127 | + If you install code-server using `npm`, and you upgrade your Node.js | ||
| 126 | 128 | version, you may need to reinstall code-server to recompile native modules. | |
| 127 | 129 | Sometimes, you can get around this by navigating into code-server's `lib/vscode` | |
| 128 | 130 | directory and running `npm rebuild` to recompile the modules. | |
@@ -136,7 +138,7 @@ A step-by-step example of how you might do this is: | |||
| 136 | 138 | ||
| 137 | 139 | ### Debugging install issues with npm | |
| 138 | 140 | ||
| 139 | - `yarn` suppresses logs when running `yarn global add`, so to debug installation issues, install with `npm` instead: | ||
| 141 | + To debug installation issues: | ||
| 140 | 142 | ||
| 141 | 143 | ```shell | |
| 142 | 144 | # Uninstall | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,7 @@ The detection method works as follows: | |||
| 55 | 55 | - Debian, Ubuntu, Raspbian: install the deb package from GitHub. | |
| 56 | 56 | - Fedora, CentOS, RHEL, openSUSE: install the rpm package from GitHub. | |
| 57 | 57 | - Arch Linux: install from the AUR (which pulls releases from GitHub). | |
| 58 | - - FreeBSD, Alpine: install from yarn/npm. | ||
| 58 | + - FreeBSD, Alpine: install from npm. | ||
| 59 | 59 | - macOS: install using Homebrew if installed otherwise install from GitHub. | |
| 60 | 60 | - All others: install the release from GitHub. | |
| 61 | 61 | ||
@@ -419,19 +419,9 @@ install_npm() { | |||
| 419 | 419 | echoh "Installing latest from npm." | |
| 420 | 420 | echoh | |
| 421 | 421 | ||
| 422 | - YARN_PATH="${YARN_PATH-yarn}" | ||
| 423 | 422 | NPM_PATH="${YARN_PATH-npm}" | |
| 424 | - if command_exists "$YARN_PATH"; then | ||
| 425 | - sh_c="sh_c" | ||
| 426 | - if [ ! "${DRY_RUN-}" ] && [ ! -w "$($YARN_PATH global bin)" ]; then | ||
| 427 | - sh_c="sudo_sh_c" | ||
| 428 | - fi | ||
| 429 | - echoh "Installing with yarn." | ||
| 430 | - echoh | ||
| 431 | - "$sh_c" "$YARN_PATH" global add code-server --unsafe-perm | ||
| 432 | - NPM_BIN_DIR="\$($YARN_PATH global bin)" echo_npm_postinstall | ||
| 433 | - return | ||
| 434 | - elif command_exists "$NPM_PATH"; then | ||
| 423 | + | ||
| 424 | + if command_exists "$NPM_PATH"; then | ||
| 435 | 425 | sh_c="sh_c" | |
| 436 | 426 | if [ ! "${DRY_RUN-}" ] && [ ! -w "$(NPM_PATH config get prefix)" ]; then | |
| 437 | 427 | sh_c="sudo_sh_c" | |
@@ -442,9 +432,9 @@ install_npm() { | |||
| 442 | 432 | NPM_BIN_DIR="\$($NPM_PATH bin -g)" echo_npm_postinstall | |
| 443 | 433 | return | |
| 444 | 434 | fi | |
| 445 | - echoerr "Please install npm or yarn to install code-server!" | ||
| 435 | + echoerr "Please install npm to install code-server!" | ||
| 446 | 436 | echoerr "You will need at least node v12 and a few C dependencies." | |
| 447 | - echoerr "See the docs https://coder.com/docs/code-server/latest/install#yarn-npm" | ||
| 437 | + echoerr "See the docs https://coder.com/docs/code-server/latest/install#npm" | ||
| 448 | 438 | ||
| 449 | 439 | exit 1 | |
| 450 | 440 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -59,11 +59,13 @@ | |||
| 59 | 59 | "eslint-import-resolver-typescript": "^2.5.0", | |
| 60 | 60 | "eslint-plugin-import": "^2.18.2", | |
| 61 | 61 | "eslint-plugin-prettier": "^4.0.0", | |
| 62 | + "json": "^11.0.0", | ||
| 62 | 63 | "prettier": "^2.2.1", | |
| 63 | 64 | "prettier-plugin-sh": "^0.8.0", | |
| 64 | 65 | "shellcheck": "^1.0.0", | |
| 65 | 66 | "stylelint": "^13.0.0", | |
| 66 | 67 | "stylelint-config-recommended": "^5.0.0", | |
| 68 | + "synp": "^1.9.10", | ||
| 67 | 69 | "ts-node": "^10.0.0", | |
| 68 | 70 | "typescript": "^4.4.0-dev.20210528" | |
| 69 | 71 | }, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments