是否有任何 npx create react app 等效于 vue cli?

use*_*249 14 vue.js npx

我想通过 npx 为我的项目安装 vue,而不是全局安装,并确保我拥有最新版本的 vue.js,就像在 react 中所做的一样。终端中的命令是什么来实现这一目标?

ton*_*y19 40

Vue CLI ( @vue/cli) 是等效的包,可以npx像这样运行:

npx @vue/cli create --default my-project
Run Code Online (Sandbox Code Playgroud)

v4.1.2 的用法输出:

$ npx @vue/cli --help
Usage: vue <command> [options]

Options:
  -V, --version                              output the version number
  -h, --help                                 output usage information

Commands:
  create [options] <app-name>                create a new project powered by vue-cli-service
  add [options] <plugin> [pluginOptions]     install a plugin and invoke its generator in an already created project
  invoke [options] <plugin> [pluginOptions]  invoke the generator of a plugin in an already created project
  inspect [options] [paths...]               inspect the webpack config in a project with vue-cli-service
  serve [options] [entry]                    serve a .js or .vue file in development mode with zero config
  build [options] [entry]                    build a .js or .vue file in production mode with zero config
  ui [options]                               start and open the vue-cli ui
  init [options] <template> <app-name>       generate a project from a remote template (legacy API, requires @vue/cli-init)
  config [options] [value]                   inspect and modify the config
  outdated [options]                         (experimental) check for outdated vue cli service / plugins
  upgrade [options] [plugin-name]            (experimental) upgrade vue cli service / plugins
  info                                       print debugging information about your environment

  Run vue <command> --help for detailed usage of given command.
Run Code Online (Sandbox Code Playgroud)

请注意,安装需要几秒钟的时间,因此在本地安装它可能是值得的。