How to set up http server correctly in MacBook Pro 2021

I think I set up wrongly, in my terminal using “npm install –save http-server” from this website

Problem with npm install –global http-server

how to uninstall it

//

how to know if I have http server install? for example I can check if I have node in my terminal by typing “node -v”

//

I try to do exactly as this video
https://www.youtube.com/watch?v=FjWbUK2HdCo&list=PLRqwX-V7Uu6Zu_uqEA6NqhLzKLACwU74X&index=5

Google it found this website https://docs.w3cub.com/npm/getting-started/fixing-npm-permissions.html

using sudo npm install http-server -g, type in my Password, then got a pop up screen don’t know what to do next, so I just click and fail 3 time again, anyone know how to bypass it?

//

I also having trouble opening zsh file in vscode using terminal due to error, so I just not open it in vscode but just plain text, and edit it in plain text, is that also the correct way? or do I need to open the zsh with vscode?