1

I've installed WP Rig on a Windows development machine running WAMPserver.

I get to Step 5 at the URL above where I need to run npm run build, and then I receive an error:

Finished 'images' after 1.91 s
[16:34:30] 'php' errored after 5.92 s
[16:34:30] Error in plugin "gulp-phpcs"
Message:
    Cannot find "C:\wamp64\www\wprig.local\wp-content\themes\wprig-master/vendor/bin/phpcs"[16:34:30] 'buildDev' errored after 5.94 s

So, I installed phpcs by navigating to /wp-content/themes/wprig-master, and running:

npm install gulp-phpcs --save-dev

Then edited composer.json to replace;

"phpcs-dev": "\"vendors/phpcs\"",

with;

"phpcs-dev": "\"node_modules/gulp-phpcs\"",

The folder C:\wamp64\www\wprig.local\wp-content\themes\wprig-master/vendor/gulp-phpcs now exists.

It contains:

enter image description here

But I still receive the following error when I run npm run build:

Message:
    Cannot find "C:\wamp64\www\wprig.local\wp-content\themes\wprig-master/node_modules/gulp-phpcs"`

Help appreciated.

Insight
  • 202
  • 3
  • 28

1 Answers1

1

Revert changes to composer.json file relating with the custom phpcs-dev script.

Your composer.json should have phpcs-dev script to be:

    "phpcs-dev": "\"vendor/bin/phpcs\"",

https://github.com/wprig/wprig/blob/v2.0.1/composer.json#L32

And not

     "phpcs-dev": "\"vendors/phpcs\"",

Then, run

 composer install

Test that phpcs-dev runs successfully by running:

 composer phpcs-dev

After taking care that the PHP dependencies are all set up the right way, proceed to installing the Javascript dependencies for WPRig by running:

npm install
Oluwafemi Sule
  • 36,144
  • 1
  • 56
  • 81
  • Thank you Oluwafemi, I complete the steps above, and then run `npm run build` again, but I receive a similar error: `'php' errored after 24 s [15:12:18] Error in plugin "gulp-phpcs" Message: Cannot find "C:\wamp64\www\wprig.local\wp-content\themes\wprig-master/node_modules/gulp-phpcs"` – Insight Jun 23 '20 at 07:14
  • I started a fresh development site to get rid of my hacks, and `npm run build` runs without error. Thank you *so* much Olu. – Insight Jun 23 '20 at 07:28