Files
vue-cli/docs/guide/installation.md
T
Haoqun Jiang d9d191f416 docs: update Node version requirement to address package manager issues (#5811) [ci skip]
It's recommended to use NPM v6 with Node.js v8, because:

1. Some of the upstream packages may accidentally introduce dependencies
that require Node.js 10+ in the `engines` field. This only leads to a
warning in NPM but will break Yarn.

2. NPM v5 does not support dependency versions starting with `npm:`,
so it can't support Vue 3 related features in Vue CLI.
2020-08-24 15:52:19 +08:00

2.5 KiB

Installation

::: warning Warning regarding Previous Versions The package name changed from vue-cli to @vue/cli. If you have the previous vue-cli (1.x or 2.x) package installed globally, you need to uninstall it first with npm uninstall vue-cli -g or yarn global remove vue-cli. :::

::: tip Node Version Requirement Vue CLI 4.x requires Node.js version 8.9 or above (v10+ recommended). You can manage multiple versions of Node on the same machine with n, nvm or nvm-windows.

As Node.js v8 has reached end-of-life, it's now recommended to use Node.js v10+ for best compatibility. If you have to stay with Node.js v8, please make sure npm v6 is used as the default package manager. (npm -v to check the version, and vue config --set packageManager npm to set the default package manager.) :::

To install the new package, use one of the following commands. You need administrator privileges to execute these unless npm was installed on your system through a Node.js version manager (e.g. n or nvm).

npm install -g @vue/cli
# OR
yarn global add @vue/cli

After installation, you will have access to the vue binary in your command line. You can verify that it is properly installed by simply running vue, which should present you with a help message listing all available commands.

You can check you have the right version with this command:

vue --version

Upgrading

To upgrade the global Vue CLI package, you need to run:

npm update -g @vue/cli

# OR
yarn global upgrade --latest @vue/cli

Project Dependencies

Upgrade commands shown above apply to the global Vue CLI installation. To upgrade one or more @vue/cli related packages (including packages starting with @vue/cli-plugin- or vue-cli-plugin-) inside your project, run vue upgrade inside the project directory:

Usage: upgrade [options] [plugin-name]

(experimental) upgrade vue cli service / plugins

Options:
  -t, --to <version>    Upgrade <plugin-name> to a version that is not latest
  -f, --from <version>  Skip probing installed plugin, assuming it is upgraded from the designated version
  -r, --registry <url>  Use specified npm registry when installing dependencies
  --all                 Upgrade all plugins
  --next                Also check for alpha / beta / rc versions when upgrading
  -h, --help            output usage information