HuddleEng / PhantomFlow

Describe and visualise user flows through tests with PhantomJS
MIT License
682 stars 60 forks source link

Error: Cannot find module '<project_directory>/node_modules/phantomflow/node_modules/phantomcss/node_modules/phantomjs' #26

Closed davidjnelson closed 9 years ago

davidjnelson commented 9 years ago

Hi, this project is awesome, thanks for creating it!

I was able to get it working straight from cloning the repo, and then integrated it into my app.

To integrate it into my app, I had to change some code around in phantomflow.js to get dependencies to load.

But, if I try to use it as an npm dependency, I get this error:

Error: Cannot find module '/node_modules/phantomflow/node_modules/phantomcss/node_modules/phantomjs'

It looks like it's looking for phantomCSS as a dependency to phantomFlow. In phantomFlow's package.json, I see phantomCSS. But when I run npm install phantomFlow --save-dev, npm puts phantomCSS as a sibling to phantomFlow in the tree, and the require at line 579 of phantomFlow fails.

I changed test.js to load phantomFlow like this:

var flow = require( path.resolve( 'node_modules' ) + '/phantomflow/phantomflow' ).init({

davidjnelson commented 9 years ago

nevermind, looks like I hit a bug in npm. deleting node_modules and npm install - ing fixed it.

http://stackoverflow.com/questions/18401606/npm-doesnt-install-module-dependencies