How can I solve problem when run test my created node, 'mocha' is not recognized as an internal or external command, operable program or batch file

In your custom node's package.json file have you defined a "test" script and if so, what is it set to?

Have you added mocha as a devDependency of your module?