use npm path for namespace when resolved is different

needs testing and probably tests but not sure how to write the tests for this feature.

Fixes: https://github.com/yeoman/yeoman/issues/1269