JavaScript for WordPress Forums Gutenberg Development 04.01 – I need a little bit more explanation to understand this Reply To: 04.01 – I need a little bit more explanation to understand this

#52119
mscheib
Participant

Hey Zac,
thank you for your patience. As you said I do the following:
a.) I install nodejs on my PC
b.) I make a local WordPress-installation
c.) I download the Plugin from github (again), install and activate it

And now the following thinks happened:
1.) When I try your Example-Blocks on my local WordPress-installation, the only working Block is the “Static Block”. The other Blocks show following error “This block has encountered an error and cannot be previewed.”
2.) On Atom I open the Plugin-Folder (the folder with the package.json in it) and try “npm install”. Than I get the following code:

PS C:\Wordpress\apps\wordpress\htdocs\wp-content\plugins\jsforwp-example-blocks> npm install
npm WARN jsforwp-blocks@1.0.0 No description
npm WARN jsforwp-blocks@1.0.0 No repository field.

up to date in 1.098s
PS C:\Wordpress\apps\wordpress\htdocs\wp-content\plugins\jsforwp-example-blocks>

Because of the missing description and repository field in the package.json , I add these fields manually.
After this I try “npm run dev” and get the following errors:

jsforwp-blocks@1.0.0 dev C:\Wordpress\apps\wordpress\htdocs\wp-content\plugins\jsforwp-example-blocks
> cross-env BABEL_ENV=default webpack --watch

Der Befehl "cross-env" ist entweder falsch geschrieben oder
konnte nicht gefunden werden. (The command "cross-env" is not written correctly or couldn´t be found.)

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! jsforwp-blocks@1.0.0 dev: <code>cross-env BABEL_ENV=default webpack --watch</code>
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the jsforwp-blocks@1.0.0 dev script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm WARN Local package.json exists, but node_modules missing, did you mean to install?

Thanks for your help.