1

I was looking online and came across two different run commands, its weird cause say React for instance has the command create-react-app <name of app>, but then for vue-cli I have found these two commands vue create <name of app> and vue init webpack <name of app>.

I double checked after running both commands and found that both contain webpack, but structured differently. The first one came with vuex preinstalled while the other was missing it. The second command had a lot of extra devDependencies though.

I am just a bit confused on which command is the proper one for a multiple page vuejs application that incorporates vue-router and vuex.

1 Answer 1

2

For Vue CLI v3, you can use vue create or vue ui to bootstrap an app. For Vue CLI v2, you use vue init.

If you have Vue CLI v3 installed, you can still use vue init, though it's considered a legacy API:

$ vue --version
3.0.0

$ vue init

  Usage: init [options] <template> <app-name>

  generate a project from a remote template (legacy API, requires @vue/cli-init)

  Options:

    -c, --clone  Use git clone when fetching remote template
    --offline    Use cached template
    -h, --help   output usage information

$ vue create

  Usage: create [options] <app-name>

  create a new project powered by vue-cli-service

  Options:

    -p, --preset <presetName>       Skip prompts and use saved or remote preset
    -d, --default                   Skip prompts and use default preset
    -i, --inlinePreset <json>       Skip prompts and use inline JSON string as preset
    -m, --packageManager <command>  Use specified npm client when installing dependencies
    -r, --registry <url>            Use specified npm registry when installing dependencies (only for npm)
    -g, --git [message]             Force git initialization with initial commit message
    -n, --no-git                    Skip git initialization
    -f, --force                     Overwrite target directory if it exists
    -c, --clone                     Use git clone when fetching remote preset
    -x, --proxy                     Use specified proxy when creating project
    -b, --bare                      Scaffold project without beginner instructions
    -h, --help                      output usage information

Vue CLI is stable at version 3, so I would make sure you have that installed, and use the vue create command or the vue ui command. The vue ui is still in beta and I have not yet tried it, but it looks nice. You can go through the CLI website for more information: https://cli.vuejs.org/.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.