This
-g
flag makes NPM install the package globally, so that the executable—in your case
codesandbox
—would be available from any directory, otherwise you will need to be in the same project where you installed it.
Just restart PowerShell, as the window temporarily caches the executables and might cause a problem. Restart the PowerShell window (or CMD) and you will have it, if everything is fine. Or you can check by calling this executable in the same project first.
If that doesn't work, try re-executing the statement that they provided,
$ npm install -g codesandbox
And again, make sure you open a new window, or reboot the system if the executable doesn't work.
Don't get caught in a recursion.