fixed issue when spawn fails in newer versions of node