LucianoGanga / simple-headless-chrome

Simple abstraction to use Chrome as a Headless Browser with Node JS
MIT License
217 stars 50 forks source link

cannot find module ./build/Browser.js #55

Closed fusionx1 closed 7 years ago

fusionx1 commented 7 years ago

cannot find module ./build/Browser.js when im running node clickSelector.js, its says it cannot find the module ./build/Browser.js

    throw err;
    ^

Error: Cannot find module './build/Browser.js'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/fusionx1/Projects/pantheon/automation/newrelic_capture/simple-headless-chrome/index.js:3:18)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
fusionx1 commented 7 years ago

I found the culprit, I replaced line 3 of index.js module.exports = require('./build/Browser.js') with this: module.exports = require('./lib/Browser.js')

LucianoGanga commented 7 years ago

@fusionx1 Did you download the module from NPM or directly from Github?

I just tested this and it's working. I think that if you don't have the /build folder in your simple-headless-chrome directory, that may be because you downloaded it from Github where the build directory was ignored by default in the .gitignore file.

I'm uploading now those files in the new version, but I recommend you to use it directly from NPM.

Cheers! Luciano