Install sitespeed.io using Node.JS
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
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?
'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"
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
I followed the bash commands and executed the following:
- Installed Node.js (20.2..0) & NPM (9.6.6)
- 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?
Yes ignore the warnings, follow the Windows installation.
How can I confirm if sitespeed is installed?
You run it? Do you have any other npm dependencies installed that you can check if those work.
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."
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.
If you run as https://github.com/sitespeedio/sitespeed.io/blob/main/.github/workflows/windowsFull.yml#L34-L36 using bash, does it work?
@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:
if it does have "node_modules" then if you go into the dirs, they are empty:
Did you get any error messages when you run npm install?