mikestead / lighthouse-batch

Run Lighthouse analysis over multiple sites in a single command
MIT License
153 stars 42 forks source link

Cannot find module #61

Open jdylanmc opened 3 years ago

jdylanmc commented 3 years ago

Hi,

I am trying the following on a windows 10 machine:

npm install -g lighthouse-batch
cd C:\lighthouse
lighthouse-batch -f sites.txt --html

where sites.txt has a number of websites in it, separated by newline.

This results in the following error reported over and over:

PS C:\lighthouse> lighthouse-batch -f sites.txt --html
internal/modules/cjs/loader.js:775
    throw err;
    ^

Error: Cannot find module 'C:\Users\Dylan'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:772:15)
    at Function.Module._load (internal/modules/cjs/loader.js:677:27)
    at Function.Module.runMain (internal/modules/cjs/loader.js:999:10)
    at internal/main/run_main_module.js:17:11 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}
1/0: Lighthouse analysis FAILED for https://www.mysite.com/
internal/modules/cjs/loader.js:775
    throw err;
    ^

Is there a dependency missing or am I doing something wrong? I tried following the instructions on the readme.md but I am hitting this error in windows and a similar error in Mac OSX.

jdylanmc commented 3 years ago

For what it's worth, I am able to get this module to work by running npm init, installing the module locally to a directory, and using the script block in my package.json. I think perhaps the readme just needs to be updated as it's a bit unclear.

mikestead commented 3 years ago

Hey @jdylanmc sorry to hear you've hit some issues. I don't have access to a windows machine, but did try on mac (you mentioned it being broken there too) without any issues.

If you could give me the mac specific error, even if similar, that may give me a little more to go on. It does look like some type of dependency pathing issue you're right.