added npm to PATH
improve regexp for trailing whitespace