安装 node
官网
node -v
安装 @vue/cli
npm install -g @vue/cli
vue 命令
命令 | 作用 |
---|---|
-V / --version | 获取版本信息 |
create [options] | create a new project powered by vue-cli-service |
add [options] [pluginOptions] | install a plugin and invoke its generator in an already created project |
invoke [options] [pluginOptions] | invoke the generator of a plugin in an already created project |
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] | generate a project from a remote template (legacy API, requires @vue/cli-init) |
config [options] [value] | inspect and modify the config |
创建项目
vue create 项目名
vue init需要额外配置
查看全局模块依赖:
npm ls -g --depth 0 (可以常看但会报错)
移除已安装的全局模块
npm uninstall 模块名 -g 或 yarn global remove 模块名(需要安装yarn)
可在 npmjs.com 搜索模块获取相关信息