Sometimes you need to just restart your terminal or editor (like visual studio code), so it will know that npm and node exist, before it will work.
That's what I needed to do to get things working.