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]