When running yo @microsoft/sharepoint, it would ask for _"Which baseline packages do you want to target for your components(s)?"_ as second question.
It doesn't ask for the baseline packages, but instead defaults to on-prem settings.
PS C:\git> yo @microsoft/sharepoint
_-----_
| | .--------------------------.
|--(o)--| | Welcome to the |
`---------麓 | SharePoint Client-side |
( _麓U`_ ) | Solution Generator |
/___A___\ '--------------------------'
| ~ |
__'.___.'__
麓 ` |掳 麓 Y `
Let's create a new SharePoint solution.
? What is your solution name? SharePoint.SPFx.HttpFetch
? Where do you want to place the files? Create a subfolder with solution name
Found npm version 6.4.1
? Which type of client-side component to create? WebPart
Add new Web part (on-prem) to solution share-point-sp-fx-http-fetch.
? What is your Web part (on-prem) name? HttpFetch
? What is your Web part (on-prem) description? HttpFetch description
? Which framework would you like to use? No JavaScript framework
yo @microsoft/sharepointyo @microsoft/sharepoint --environment "spo"Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.
Hi @jpalo
Sounds like you may have initiated the command in an existing SPFx solution folder, and/or there is an existing .yo-rc.json file higher up in your folder structure. (SPFx solutions allow you add multiple webparts/extensions to a single SPFx project)
So if there is an existing .yo-rc.json file, it will re-use that configuration... instead of asking you to select an environment.
Thank you very much for pointing out this "user error", I had apparently created SPFx project to the root some time earlier by mistake and didn't realize it. 馃槉
Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues
Most helpful comment
Hi @jpalo
Sounds like you may have initiated the command in an existing SPFx solution folder, and/or there is an existing .yo-rc.json file higher up in your folder structure. (SPFx solutions allow you add multiple webparts/extensions to a single SPFx project)
So if there is an existing .yo-rc.json file, it will re-use that configuration... instead of asking you to select an environment.