single-spa / create-single-spa

https://single-spa.js.org/docs/create-single-spa
Other
128 stars 60 forks source link

`npx create-single-spa@latest` fails when creating a Vue application/parcel #359

Open rfrankspk opened 2 years ago

rfrankspk commented 2 years ago

Describe the bug or question npx create-single-spa@latest fails when creating a Vue application/parcel...

To Reproduce

npx create-single-spa
? Directory for new project .
? Select type to generate single-spa application / parcel
? Which framework do you want to use? vue
? Organization name (can use letters, numbers, dash or underscore) 
commure

Expected behavior Vue parcel is created successfully.

Screenshots and/or console output

Richards-MacBook-Pro:vue-poc rfranks$ npx create-single-spa
? Directory for new project .
? Select type to generate single-spa application / parcel
? Which framework do you want to use? vue
? Organization name (can use letters, numbers, dash or underscore) 
commure
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

  Unknown option --skipGetStarted.

Richards-MacBook-Pro:vue-poc rfranks$ npx create-single-spa@latest
Need to install the following packages:
  create-single-spa@latest
Ok to proceed? (y) 
? Directory for new project .
? Select type to generate single-spa application / parcel
? Which framework do you want to use? vue
? Organization name (can use letters, numbers, dash or underscore) 
commure
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

  Unknown option --skipGetStarted.

Additional context

Richards-MacBook-Pro:vue-poc rfranks$ vue --version
3.3.0
Garlant commented 1 year ago

Hi, I have a similiar issue. Except, I'm using a windows 10 system.

Behavior is as follows:

PS C:\Users\xxx\workspace\vue-parcel> create-single-spa      
? Directory for new project xx
? Select type to generate single-spa application / parcel
? Which framework do you want to use? vue
? Organization name (can use letters, numbers, dash or underscore) xx
PS C:\Users\xxx\workspace\vue-parcel> 

I cloned the project and had a look into why it is also happening on my machine... There I found out that the error occurs only when @vue/cli is globally installed.

In case I had @vue/cli globally installed, it was using command vue and some lines below applied .cmd to command.

When it then tried to create the vue project, it failed because it could not find/recognize vue.cmd.
So, after removing the if-branch, including .cmd, it worked fine. With and without globally installed @vue/cli.

@rfrankspk Does it also occur to you, if there is no globally installed @vue/cli?

cgfeel commented 1 month ago

update you local environment vue/cli npm install -g @vue/cli