This is the issue related to yeoman. You can fix this issue by downgrading it from 4.0.0 to 3.1.1
npm install firstname.lastname@example.org -g
This combination does not work
This combination works
Similar question was asked here.
You have to select "SharePoint Online only (latest)" or "SharePoint 2019 onwards, including SharePoint Online" for the question Which baseline packages do you want to target for your component(s)? to get option for "Extension".
If the answer is helpful, please upvote and mark as accepted.
SharePoint 2016 does not support SPFx extensions.
This is because SharePoint 2016 on-premises doesn't support Modern UI.
SharePoint Extensions are supported only in SharePoint 2019 and SharePoint Online as of now.
In order to create a SharePoint Extension choose any one of the below options for the question, Which baseline packages do ...
With SPFx solutions, none of the npm packages are deployed to SharePoint, so you can ignore these audit warnings. If you had a custom solution that did deploy the npm packages themselves, yes you'd need to address it.
Don't be alarmed by vulnerabilities after running NPM Install
Below are requirement to run and test SPFx 1.12.1 webpart.
node version v14.15.5
gulp serve will work with current release and with the next release.
local work bench will work with current SPFx version 1.12.1. In next release it won't be supported.
You can test ...
I am assuming that you have installed only one version of nodejs at a time. For SPFx generator SharePoint online you will require v10.24.0 of nodejs.
Open command prompt and run following command in CMD to check global version of package
npm list -g --depth=0
Ideally it should display following following version
Its not just these few changes that you will help you convert.
SP ON-prem only support SPFx 1.4 which only supports React 15(not latest React with Hooks) and so other libraries dependencies change similarly and is a difference of complete dependency chain.
The closest to what you want can be achieved using workarounds like: LINK