them-es / starter-bootstrap

Bootstrap 5 WordPress Starter Theme.
https://them.es/starter-bootstrap
GNU General Public License v2.0
147 stars 53 forks source link

Error: PostCSS plugin - after npm run watch and changing something from main.scss #8

Closed ableslayer closed 2 years ago

ableslayer commented 2 years ago

Hi

I have installed npm and run npm run watch. After I changed the main.scss, it gives this error

[01:24:49] Starting 'watch'...
[01:25:02] Starting 'build_css'...
[01:25:03] 'build_css' errored after 1.05 s
[01:25:03] Error: PostCSS plugin postcss-discard-comments requires PostCSS 8.
Migration guide for end-users:
https://github.com/postcss/postcss/wiki/PostCSS-8-for-end-users
    at Processor.normalize (C:\xampp\htdocs\user\wp-content\themes\themename\node_modules\postcss\lib\processor.js:167:15)
    at new Processor (C:\xampp\htdocs\user\wp-content\themes\themename\node_modules\postcss\lib\processor.js:56:25)
    at postcss (C:\xampp\htdocs\user\wp-content\themes\themename\node_modules\postcss\lib\postcss.js:55:10)
    at cssnanoPlugin (C:\xampp\htdocs\user\wp-content\themes\themename\node_modules\cssnano\dist\index.js:145:31)
    at build_css (C:\xampp\htdocs\user\wp-content\themes\themename\gulpfile.js:66:3)
    at bound (domain.js:416:15)
    at runBound (domain.js:427:12)
    at asyncRunner (C:\xampp\htdocs\user\wp-content\themes\themename\node_modules\async-done\index.js:55:18)
    at processTicksAndRejections (internal/process/task_queues.js:77:11)

What could be the fix for this?

them-es commented 2 years ago

Hi @ableslayer,

according to the Migration guide in your error log postcss is required. Could you replace your package.json with the current one to add postcss as a dependency: https://github.com/them-es/themes-starter-bootstrap/blob/main/package.json#L29

Afterwards you need to update all packages: npm update

ableslayer commented 2 years ago

U just ran npm install again and now it's working properly. Thanks!