sitespeed.io icon indicating copy to clipboard operation
sitespeed.io copied to clipboard

Install sitespeed.io using Node.JS

Open sabe-ran29 opened this issue 1 year ago • 12 comments

Your question

I'm new to sitespeed.io and looking for help to install it using Node.JS I followed the instructions mentioned in website, however I don't get any results output file when running sitespeed.io . Can someone help me with this? Following are the log: npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142 changed 717 packages in 44s 160 packages are looking for funding run npm fund for details

sabe-ran29 avatar Jan 10 '25 16:01 sabe-ran29

Hi @sabe-ran29 thank you for creating the issue, this are warnings from dependencies and dependencies, what happens if you run sitespeed.io after, does it work?

soulgalore avatar Jan 10 '25 16:01 soulgalore

'sitespeed.io' is not recognized as an internal or external command, operable program or batch file. I'm seeing the above message when I run "sitespeed.io"

sabe-ran29 avatar Jan 10 '25 16:01 sabe-ran29

If you are using Windows, try starting it from bash shell, there's an example on how you can install/run in the Windows GitHub action: https://github.com/sitespeedio/sitespeed.io/blob/main/.github/workflows/windowsFull.yml

soulgalore avatar Jan 10 '25 16:01 soulgalore

I followed the bash commands and executed the following:

  1. Installed Node.js (20.2..0) & NPM (9.6.6)
  2. Run "npm install sitespeed.io -g" & observed the following: ===================== _npm WARN deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info. npm WARN deprecated [email protected]: this library is no longer supported npm WARN deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142

changed 717 packages in 41s

160 packages are looking for funding run npm fund for details_

Should I ignore these warning messages? I have google chrome installed already. Should I need to install all the dependencies mentioned in windowsfull.yml?What are the next steps to be followed?

sabe-ran29 avatar Jan 10 '25 18:01 sabe-ran29

Yes ignore the warnings, follow the Windows installation.

soulgalore avatar Jan 10 '25 19:01 soulgalore

How can I confirm if sitespeed is installed?

sabe-ran29 avatar Jan 10 '25 21:01 sabe-ran29

You run it? Do you have any other npm dependencies installed that you can check if those work.

soulgalore avatar Jan 11 '25 13:01 soulgalore

Yes, i run sitespeed in bash commands and getting the following message. "'sitespeed.io' is not recognized as an internal or external command, operable program or batch file."

sabe-ran29 avatar Jan 13 '25 12:01 sabe-ran29

I came across this very same issue running on node… after installation I tried to run pagespeed.io but it kept redirecting me to a file on the browser with “ #!/bin/sh basedir=$(dirname "$(echo "$0" | sed -e 's,\,/,g')") case uname in cygwin|mingw|msys) basedir=cygpath -w "$basedir";; esac if [ -x "$basedir/node" ]; then exec "$basedir/node" "$basedir/node_modules/sitespeed.io/bin/sitespeed.js" "$@" else exec node "$basedir/node_modules/sitespeed.io/bin/sitespeed.js" "$@" fi”…. It does run really good on docker but I couldn’t get it run tests on node.

rupam2234 avatar Feb 16 '25 00:02 rupam2234

If you run as https://github.com/sitespeedio/sitespeed.io/blob/main/.github/workflows/windowsFull.yml#L34-L36 using bash, does it work?

soulgalore avatar Feb 17 '25 06:02 soulgalore

@soulgalore @rupam2234 @sabe-ran29 The way I have been running sitespeed.io on Windows with node is as follows:

  • Follow doc install instructions and use node version 20
  • Go to sitespeed.io dir using w. power shell and run sitespeed: "node bin/sitespeed.js -b chrome -n 1 --video --visualMetrics --viewPort 1024x768 https://www.google.com/"
  • I have come across where it asks to install lodash packages: https://stackoverflow.com/questions/27431187/cannot-find-module-lodash
  • It does not work if you try to run sitespeed.io globally; this works on Mac fine but not Windows even if you install it on windows as -g

However, the latest release does not work and after taking a quick glance at it, looks like it is missing whole "node_modules" dir:

Image

if it does have "node_modules" then if you go into the dirs, they are empty:

Image

2343909 avatar Mar 11 '25 13:03 2343909

Did you get any error messages when you run npm install?

soulgalore avatar Mar 20 '25 13:03 soulgalore