The new NPM(version 3.3.3) will install dependencies directly into the node_modules directory as much as possible rather than installing them hierarchically.
So, there might not be a node_modules directory inside node_modules/mocha-phantomjs/, see here
It's better to do the path.resolve thing with require.resolve()
The new
NPM
(version 3.3.3) will install dependencies directly into thenode_modules
directory as much as possible rather than installing them hierarchically.So, there might not be a
node_modules
directory insidenode_modules/mocha-phantomjs/
, see hereIt's better to do the
path.resolve
thing withrequire.resolve()