Vue CLI v3.4.1
? Please pick a preset: default (babel, eslint)
Vue CLI v3.4.1
✨ Creating project in /Users/wangweiren/Documents/project/vue-hello.
? Initializing git repository...
⚙ Installing CLI plugins. This might take a while...
// https://www.npmjs.com/package/fsevents
// 可以监听某个目录
> fsevents@1.2.7 install /Users/wangweiren/Documents/project/vue-hello/node_modules/fsevents
> node install[fsevents] Success: "/Users/wangweiren/Documents/project/vue-hello/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" is ins
talled via remote
> yorkie@2.0.0 install /Users/wangweiren/Documents/project/vue-hello/node_modules/yorkie
> node bin/install.js
setting up Git hooks
done
added 1181 packages from 657 contributors and audited 23486 packages in 57.302s
found 0 vulnerabilities
? Invoking generators...
? Installing additional dependencies...
added 37 packages from 28 contributors, updated 2 packages, moved 9 packages and audited 23774 packages in 28.952s
found 0 vulnerabilities
⚓ Running completion hooks...
? Generating README.md...
? Successfully created project vue-hello.
? Get started with the following commands:
$ cd vue-hello
$ npm run serve
vue 命令的node代码
#!/usr/bin/env node
program
.command('create <app-name>')
.description('create a new project powered by vue-cli-service')
.option('-p, --preset <presetName>', 'Skip prompts and use saved or remote preset')
.option('-d, --default', 'Skip prompts and use default preset')
.option('-i, --inlinePreset <json>', 'Skip prompts and use inline JSON string as preset')
.option('-m, --packageManager <command>', 'Use specified npm client when installing dependencies')
.option('-r, --registry <url>', 'Use specified npm registry when installing dependencies (only for npm)')
.option('-g, --git [message]', 'Force git initialization with initial commit message')
.option('-n, --no-git', 'Skip git initialization')
.option('-f, --force', 'Overwrite target directory if it exists')
.option('-c, --clone', 'Use git clone when fetching remote preset')
.option('-x, --proxy', 'Use specified proxy when creating project')
.option('-b, --bare', 'Scaffold project without beginner instructions')
.action((name, cmd)=> {
const options = cleanArgs(cmd)
if (minimist(process.argv.slice(3))._.length > 1){
console.log(chalk.yellow('\n Info: You provided more than one argument. The first one will be used as the app\'s name, the rest are ignored.'))}
// --git makes commander to default git to trueif(process.argv.includes('-g')|| process.argv.includes('--git')){
options.forceGit =true}
require('../lib/create')(name, options)})