modify npm check method

In previous versions of node.js, default output is 0, in latest version default output is 1. Use `npm version` to check whether npm is correctly installed.