Error on wp-block build

[ad_1]

I’m using the @wordpress/create-block package for creating and managing blocks. It worked nicely untill I decided to remove the node_modules folder in order to decrease block file size. Now I need to make a minor change to my block but every time I run “npm start” or “npm run build” the terminal returns the error:

sh: 1: wp-scripts: not found

I searched the documentation, GitHub and Stack Overflow for a possible fix, but found nothing.

My setup:
Php 8.1
Node 18.17.1
WP 6.3.1
Linux Mint 21.1 Vera

Also, what would be the best way to keep those module folders in block in my development environment but ignore them in production? Would that be git? I’ve heard that using WordPress with git is not the best idea.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer