sitespeedio / plugin-lighthouse

Lighthouse plugin for sitespeed.io
MIT License
28 stars 18 forks source link

Error in Package installation using NPM #124

Closed shrutiseth closed 7 months ago

shrutiseth commented 7 months ago

I am getting error while installing this package using - npm install sitespeed.io/plugin-lighthouse -g -y

NPM Lighthouse Plugin error

Please help here!

soulgalore commented 7 months ago

Hi @shrutiseth you are missing a @ in front of sitespeed.io, please try: npm install @sitespeed.io/plugin-lighthouse

shrutiseth commented 7 months ago

Hi @soulgalore - Thanks for your response. But I get below error:

image
shrutiseth commented 7 months ago

I did - npm i @sitespeed.io/plugin-lighthouse it did get installed. But when I ran audit using -

image

it gives error - c_ode: 'ERR_MODULE_NOT_FOUND', _url: 'file:///C:/Users/shruti.s.seth/OneDrive%20-%20Accenture/PerfTools_SS/sitespeed.io/lib/plugin-lighthouse/index.js'__

It is not able to find lib/plugin-lighthouse/index.js, it is not there in directory either.

So I downloaded from github and manually moved it to /lib/ location, after which the audit ran.

Can you please check if the package is correct from your side? As last month it was all fine. Getting issue now only. I have to do the setup without docker, hence need your support. Thank you for your time!

soulgalore commented 7 months ago

I think on Windows the paths to the plugin maybe needs some love, I tried in a Windows GitHub action and it also fails for me. Installing globally works though, can you try that?

npm install sitespeed.io -g
npm install "@sitespeed.io/plugin-lighthouse" -g
sitespeed.io --plugins.add "@sitespeed.io/plugin-lighthouse" --plugins.remove browsertime https://www.sitespeed.io/
shrutiseth commented 7 months ago

@soulgalore - Than you for your response. However when running the audit command, I am getting below:

image

Nothing happens, and instead, "C:\Users\shruti.s.seth\AppData\Roaming\npm\sitespeed.io" file opens up as seen in my screenshot. I uninstalled nodejs, nvm, npm, deleted git repo and did everything again, still getting this error

however, when I executed with node keyword added infront

node bin/sitespeed.js https://www.sitespeed.io/ -n 1 -b chrome I get the audit report. But when i run below command given by you, it again gives plugin not found:

node sitespeed.io --plugins.add "@sitespeed.io/plugin-lighthouse" --plugins.remove browsertime https://www.sitespeed.io/

image

Please advise, at which path exactly should I run this command? Thank you for your time to respond me, I really appreciate it.

Am trying to do whole setup without Docker. If you have a repo with Influx DB/Graphite and Grafana integration using NodeJS, please do share the URL. Thanks.

soulgalore commented 7 months ago

If you switch to bash from powershell do that work?

shrutiseth commented 7 months ago

@soulgalore - Thank you so much for your prompt response. It is working through Git Bash! :)

image

shrutiseth commented 7 months ago

Closing this issue as @soulgalore suggested to install Lighthouse package globally -

npm install sitespeed.io -g npm install "@sitespeed.io/plugin-lighthouse" -g sitespeed.io --plugins.add "@sitespeed.io/plugin-lighthouse" --plugins.remove browsertime https://www.sitespeed.io/