First Sharepoint SPFx hassles

What a nightmare. First, if you have Visual Studio – you have to have a new product and like most Microsoft Coding products it has a name SO CLOSE to the familiar – you have a watch a video to figure it out. VISUAL STUDIO (that is used to code) IS NOT THE SAME AS VISUAL STUDIO CODE (download and install that first).

You have to run node 8.x or 10.x as per this Microsoft Article – it happened when I went to

gulp trust-dev-cert and it gave me the gears.

DONT USE THIS!!!! To change node version on windows use nodist (install it using chocolatey) and runchoco install nodistThen run a new powershell. If you run into “The file C:\Program Files (x86)\Nodist\bin\nodist.ps1 is not digitally signed” then run –END DONT USE

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

then downgrade to npm 10.20.1 Well that didn’t work – so lets get nvm-windows installed. Keep reading (yes – nvm-windows worked).

Remember to delete all nvm, npm and node from %APPDATA%\Local, %APPDATA%\Roaming and c:\Program files and the %USERNAME%\.npmrc … everthing. Even ENVIRONMENT VARIABLES … UNINSTALL EVERYTHING TO DO WITH NODE FIRST. Choose the .zip download with setup AS ADMINISTRATOR. Once installed

nvm list
nvm install 10.20.1
nvm use 10.20.1

node -v

Start Visual Studio – then go to Tools->Powershell Prompt (no that is not clear in the instructions)

Reinstall all our npm’s to do with sharepoint.
npm install -g yo gulp
npm install -g @microsoft/generator-sharepoint
npm ls @microsoft/generator-sharepoint -g --depth=0
npm install gulp-cli -g (to reinstall gulp for this version)

fix or recreate yo.cmd, yo.ps1 if you have to (I did)

yo @microsoft/sharepoint
gulp trust-dev-cert

FINALLY SUCCESS and the danged Trust popup – click Yes.

Done and off to bed. I still have it in for MS and Sharepoint.