xxxxxxxxxx
// install Node Vertion Maniger (nvm)
https://github.com/coreybutler/nvm-windows/releases/download/1.1.9/nvm-setup.exe
// Launch windows ternimal as administrator
Right click start >> Select "Windows Terminal (admin)"
// Run the following commands to install and use the right node version (16.17.0)
nvm install 16
nvm on
nvm use 16.17.0
// Install gulp, yeoman and microsoft/generator
npm install gulp-cli yo @microsoft/generator-sharepoint --global
// create your project folder
mkdir helloworld && cd helloworld
// generate sharepoint/online webpart
yo @microsoft/sharepoint
// Complete the following
? What is your solution name? HelloWorld <!-- enter the sulution name -->
? Which type of client-side component to create? WebPart <!-- select WebPart -->
Add new Web part to solution helloworld. <!-- project name -->
? What is your Web part name? Hello World <!-- project name -->
? Which template would you like to use? No framework <!-- select no framework -->
// Open up your code editor and head to the following file
config >> serve.json
// Enge the following line
"initialPage": "https://mysite.sharepoint.com/_layouts/workbench.aspx" <!-- enter the link to your sharepoint site where it says mysite.sharepoint.com -->
// return to your terminal and run
gulp trust-dev-cert
// then run
gulp serve