bleech / visual-regression-tests

Find issues before others do – every time. With automatic screenshots, daily comparisons, and instant tests after WordPress and plugin updates.
https://vrts.app/
GNU General Public License v2.0
4 stars 0 forks source link

npm run build fails on Windows 10 with error #60

Closed billiemead closed 10 months ago

billiemead commented 10 months ago

OS: Windows 10 NPM: 7.10.0 NodeJS: 16.0.0 VRT: 1.7.1 WP: 6.3.1 PHP: 7.4

CMD: npm run build Error: '.' is not recognized as an internal or external command, (verbose log below) Related: https://github.com/yarnpkg/yarn/issues/1729

When using Windows OS package.json cannot use ./ for paths, so the first script to fail is lint:php because of the path ./vendor/bin/phpcs

Fix I used: Replacing / with \\

npm verb cli [
npm verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'run',
npm verb cli   'build',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@7.10.0
npm info using node@v16.0.0
npm timing npm:load:whichnode Completed in 2ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:L:\nvm\v16.0.0\node_modules\npm\npmrc Completed in 0ms
npm timing config:load:builtin Completed in 0ms
npm timing config:load:cli Completed in 2ms
npm timing config:load:env Completed in 0ms
npm timing config:load:file:G:\laragon-6.0.0\www\elevartherapeutics-clone\wp-content\plugins\visual-regression-tests\.npmrc Completed in 0ms  
npm timing config:load:project Completed in 1ms
npm timing config:load:file:C:\Users\Billie Mead\.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 6ms
npm timing npm:load:configload Completed in 6ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 0ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 0ms
npm timing npm:load Completed in 25ms
npm timing config:load:flatten Completed in 2ms

> @bleech/visual-regression-tests@1.7.1 build
> run-s lint wp:scripts:build

npm verb cli [
npm verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'L:\\nvm\\v16.0.0\\node_modules\\npm\\bin\\npm-cli.js',
npm verb cli   'run',
npm verb cli   'lint'
npm verb cli ]
npm info using npm@7.10.0
npm info using node@v16.0.0
npm timing npm:load:whichnode Completed in 1ms
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:L:\nvm\v16.0.0\node_modules\npm\npmrc Completed in 0ms
npm timing config:load:builtin Completed in 0ms
npm timing config:load:cli Completed in 1ms
npm timing config:load:env Completed in 2ms
npm timing config:load:file:G:\laragon-6.0.0\www\elevartherapeutics-clone\wp-content\plugins\visual-regression-tests\.npmrc Completed in 0ms  
npm timing config:load:project Completed in 0ms
npm timing config:load:file:C:\Users\Billie Mead\.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:C:\Program Files\nodejs\etc\npmrc Completed in 1ms
npm timing config:load:global Completed in 1ms
npm timing config:load:validate Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 7ms
npm timing npm:load:configload Completed in 7ms
npm timing npm:load:setTitle Completed in 0ms
npm timing npm:load:setupLog Completed in 1ms
npm timing npm:load:cleanupLog Completed in 1ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 0ms
npm timing npm:load Completed in 24ms
npm timing config:load:flatten Completed in 2ms

> @bleech/visual-regression-tests@1.7.1 lint
> run-p lint:*

npm verb cli [
npm verb cli   'C:\\Program Files\\nodejs\\node.exe',
npm verb cli   'L:\\nvm\\v16.0.0\\node_modules\\npm\\bin\\npm-cli.js',
npm verbnpm cli   'run',
npm verb  cli [
verbnpm  cliverb    'lint:js'
clinpm   'C:\\Program Files\\nodejs\\node.exe',
 verb cli ]
npmnpm  verbinfo  cliusing   'L:\\nvm\\v16.0.0\\node_modules\\npm\\bin\\npm-cli.js',
 npm@7.10.0
npmnpm  verbinfo  cli   'run',
usingnpm node@v16.0.0
 npmnpmverb  timingcli    'lint:css'
npm:load:whichnode npmverb Completed in 1ms
  npmverbcli   [
timingclinpm  ]
 config:load:defaultsverb Completed in 1ms
npm npm cli info   'C:\\Program Files\\nodejs\\node.exe',
timing npm using config:load:file:L:\nvm\v16.0.0\node_modules\npm\npmrc npm@7.10.0
verb Completed in 0ms
npm npm cli info   'L:\\nvm\\v16.0.0\\node_modules\\npm\\bin\\npm-cli.js',
timing npm using config:load:builtin node@v16.0.0
verb Completed in 0ms
 npmnpmcli     'run',
timingtimingnpm   npm:load:whichnodeconfig:load:cliverb Completed in 1ms
 Completed in 2ms
 npmnpmcli     'lint:php'
timingtimingnpm   config:load:defaultsconfig:load:envverb Completed in 1ms
 Completed in 1ms
 npmnpmcli   ]
timingtiming  npmconfig:load:file:L:\nvm\v16.0.0\node_modules\npm\npmrcconfig:load:file:G:\laragon-6.0.0\www\elevartherapeutics-clone\wp-content\plugins\visual-regression-tests\.npmrc  Completed in 0ms
 Completed in 0ms
infonpmnpm  npm usingtimingtiming npm@7.10.0
  npm config:load:projectconfig:load:builtin  Completed in 0ms
verb Completed in 0ms
infonpm npmcli    [
timingusingtimingnpm   node@v16.0.0
 config:load:file:C:\Users\Billie Mead\.npmrcconfig:load:clinpm Completed in 1ms
verb Completed in 1ms
 npm npmtiming cli  timingtiming   'C:\\Program Files\\nodejs\\node.exe',
npm:load:whichnode  npm Completed in 1ms
config:load:userconfig:load:env npm Completed in 1ms
 Completed in 2ms
verb npmnpm timing  cli timingtiming   'L:\\nvm\\v16.0.0\\node_modules\\npm\\bin\\npm-cli.js',
config:load:defaults  npm Completed in 1ms
config:load:file:C:\Program Files\nodejs\etc\npmrcconfig:load:file:G:\laragon-6.0.0\www\elevartherapeutics-clone\wp-content\plugins\visual-regression-tests\.npmrc npm Completed in 1ms
 Completed in 0ms
verb npmnpm timing  cli timingtiming   'run',
config:load:file:L:\nvm\v16.0.0\node_modules\npm\npmrc  npm Completed in 1ms
config:load:globalconfig:load:project npm Completed in 1ms
 Completed in 0ms
verb npmnpm timing  cli timingtiming   'lint:pkg-json'
config:load:builtin  npm Completed in 1ms
config:load:validateconfig:load:file:C:\Users\Billie Mead\.npmrc npm Completed in 1ms
 Completed in 1ms
verb npmnpm timing  cli timingtiming ]
config:load:cli   Completed in 1ms
config:load:setEnvsconfig:load:usernpmnpm Completed in 0ms
 Completed in 1ms
  npmnpminfotiming    timingtimingusingconfig:load:env   npm@7.10.0
 Completed in 1ms
config:loadconfig:load:file:C:\Program Files\nodejs\etc\npmrcnpmnpm Completed in 7ms
 Completed in 0ms
  npmnpminfotiming    timingtimingusingconfig:load:file:G:\laragon-6.0.0\www\elevartherapeutics-clone\wp-content\plugins\visual-regression-tests\.npmrc   node@v16.0.0
 Completed in 0ms
npm:load:configloadconfig:load:globalnpmnpm Completed in 7ms
 Completed in 0ms
  npmnpmtimingtiming    timingnpm:load:whichnodeconfig:load:projecttiming  Completed in 1ms
 Completed in 0ms
 npm:load:setTitlenpmnpmconfig:load:validate Completed in 1ms
   Completed in 2ms
npmtimingtimingnpm    timingconfig:load:defaultsconfig:load:file:C:\Users\Billie Mead\.npmrctiming  Completed in 1ms
 Completed in 2ms
 npm:load:setupLognpmnpmconfig:load:setEnvs Completed in 0ms
   Completed in 0ms
npmtimingtimingnpm    timingconfig:load:file:L:\nvm\v16.0.0\node_modules\npm\npmrcconfig:load:usertiming  Completed in 0ms
 Completed in 2ms
 npm:load:cleanupLognpmnpmconfig:load Completed in 1ms
   Completed in 7ms
timingnpmtimingnpm    config:load:builtintimingconfig:load:file:C:\Program Files\nodejs\etc\npmrctiming Completed in 0ms
  Completed in 0ms
 npmnpm:load:configScopenpmnpm:load:configload  Completed in 0ms
  Completed in 7ms
timingtimingnpm   config:load:cliconfig:load:globaltiming Completed in 2ms
 Completed in 0ms
 npmnpm:load:setTitlenpm  Completed in 0ms
 timingnpmtiming npm  config:load:env timingconfig:load:validate Completed in 1ms
timing  Completed in 1ms
npm npm:load:setupLognpm npm:load:projectScope Completed in 1ms
 timing Completed in 0ms
npmtiming   config:load:file:G:\laragon-6.0.0\www\elevartherapeutics-clone\wp-content\plugins\visual-regression-tests\.npmrctimingnpmconfig:load:setEnvs Completed in 0ms
   Completed in 1ms
npmnpm:load:cleanupLogtimingnpm  Completed in 1ms
  timingnpmnpm:loadtiming   Completed in 38ms
 config:load:projecttimingconfig:load Completed in 1ms
  Completed in 8ms
npmnpm:load:configScopenpm  Completed in 0ms
 timingtiming  config:load:file:C:\Users\Billie Mead\.npmrcnpm:load:configload Completed in 1ms
 Completed in 8ms
npmnpm  timingtiming  config:load:usernpm:load:setTitle Completed in 1ms
 Completed in 0ms
npmnpmnpm   timingtimingtiming   npm:load:projectScopeconfig:load:file:C:\Program Files\nodejs\etc\npmrcnpm:load:setupLog Completed in 1ms    
 Completed in 0ms
 Completed in 0ms
npmnpmnpm   timingnpmtimingtiming    npm:loadtimingconfig:load:globalnpm:load:cleanupLog Completed in 38ms
  Completed in 0ms
 Completed in 2ms
config:load:flattennpm Completed in 2ms
npm  timing timingnpm:load:configScope  Completed in 0ms
config:load:validate Completed in 1ms
npm timing config:load:setEnvs Completed in 1ms
npm timing config:load Completed in 8ms
npmnpm  timingtiming  npm:load:configloadnpm:load:projectScope Completed in 8ms
 Completed in 1ms
npm timingnpm  npm:load:setTitletiming Completed in 0ms
 npmnpmnpm:load   Completed in 38ms
timingtiming  config:load:flattennpm:load:setupLog Completed in 2ms
 Completed in 0ms
npm timing npm:load:cleanupLog Completed in 2ms
npm timing npm:load:configScope Completed in 0ms
npm timing npm:load:projectScope Completed in 1ms
npm timing npm:loadnpm Completed in 35ms
 timing config:load:flatten Completed in 2ms
npm timing config:load:flatten Completed in 2ms

> @bleech/visual-regression-tests@1.7.1 lint:js
> wp-scripts lint-js '**/*.js'

> @bleech/visual-regression-tests@1.7.1 lint:css
> wp-scripts lint-style '**/*.scss'

> @bleech/visual-regression-tests@1.7.1 lint:php
> ./vendor/bin/phpcs

> @bleech/visual-regression-tests@1.7.1 lint:pkg-json
> wp-scripts lint-pkg-json

'.' is not recognized as an internal or external command,
operable program or batch file.
npm timing command:run-script Completed in 18ms
npm verb exit 1
npm timing npm Completed in 187ms
npm verb code 1
ERROR: "lint:php" exited with 1.
npm timing command:run-script Completed in 841ms
npm verb exit 1
npm timing npm Completed in 980ms
npm verb code 1
ERROR: "lint" exited with 1.
npm timing command:run-script Completed in 1245ms
npm verb exit 1
npm timing npm Completed in 1374ms
npm verb code 1
steffenbew commented 10 months ago

@billiemead I'm sorry to hear about your frustration with the installation process of VRTs. We obviously didn't make clear that this repository on GitHub is meant for development purposes only. That's why you need to run the build process for it to work. You will not need to run the build process if you use the published plugin.

To install the plugin on your website, please choose one of the following approaches:

  1. Install from your WordPress backend: Plugins -> Add New Plugin and search for "vrts".
  2. Download from the WordPress Plugin Directory: https://wordpress.org/plugins/visual-regression-tests/.
  3. Install via composer with wpackagist: wpackagist-plugin/visual-regression-tests.

As the core team of VRTs is developing on Mac, we don't plan to support other dev environments right now, but we would greatly appreciate any fixes that add support.

I hope this helps and that VRTs will be helpful for you!

billiemead commented 10 months ago

@billiemead I'm sorry to hear about your frustration with the installation process of VRTs. We obviously didn't make clear that this repository on GitHub is meant for development purposes only. That's why you need to run the build process for it to work. You will not need to run the build process if you use the published plugin.

To install the plugin on your website, please choose one of the following approaches:

  1. Install from your WordPress backend: Plugins -> Add New Plugin and search for "vrts".
  2. Download from the WordPress Plugin Directory: https://wordpress.org/plugins/visual-regression-tests/.
  3. Install via composer with wpackagist: wpackagist-plugin/visual-regression-tests.

As the core team of VRTs is developing on Mac, we don't plan to support other dev environments right now, but we would greatly appreciate any fixes that add support.

I hope this helps and that VRTs will be helpful for you!

Thank you! That was a very helpful reply, and was exactly the steps I took to install the plugin... with a small change for Windows OS. I will make a pull request with suggestions for Windows PC. I am still not able to generate screenshots but will create a separate issue if you would like to close this as resolved?

steffenbew commented 10 months ago

@billiemead I'm glad to hear that!

It's surprising that the screenshots still do not generate for you. Please ensure that the website is publicly accessible in order to set up and run the tests. Password protection or any kind of firewall might prevent the plugin from working correctly.

If you continue to have issues with the usage, please open a new ticket here on GitHub, or in the WordPress Support Forum.