fix #671, external flag doesn't work with node modules