Create a Block Tutorial – npm errors
-
Hello,
I’m following the Create a Block Tutorial.
I made my local wordpress install with xampp 7.4.27 on linux. From my plugin directory I run `npx @wordpress/create-block gutenpride
then I activated the plugin and succesfully inserted the new block in a new page.Everything is fine until I try to run `npm run build
inside the “gutenpride” folder as suggested here (https://developer.www.ads-software.com/block-editor/getting-started/create-block/attributes/)Here’s the output:
> [email protected] build /opt/lampp/htdocs/wp/wp-content/plugins/gutenpride > wp-scripts build [webpack-cli] Failed to load '/opt/lampp/htdocs/wp/wp-content/plugins/gutenpride/node_modules/@wordpress/scripts/config/webpack.config.js' config [webpack-cli] SyntaxError: /opt/lampp/htdocs/wp/wp-content/plugins/gutenpride/src/block.json: Unexpected token } in JSON at position 339 at parse (<anonymous>) at Object.Module._extensions..json (internal/modules/cjs/loader.js:1128:22) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:101:18) at /opt/lampp/htdocs/wp/wp-content/plugins/gutenpride/node_modules/@wordpress/scripts/utils/config.js:197:9 at Array.reduce (<anonymous>) at getWebpackEntryPoints (/opt/lampp/htdocs/wp/wp-content/plugins/gutenpride/node_modules/@wordpress/scripts/utils/config.js:191:42) at Object.<anonymous> (/opt/lampp/htdocs/wp/wp-content/plugins/gutenpride/node_modules/@wordpress/scripts/config/webpack.config.js:89:9) npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] build: <code>wp-scripts build</code> npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /home/marco/.npm/_logs/2022-02-08T10_53_05_042Z-debug.log
I also did `npm run packages-update
but it doesn’t help.Suggestions?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Create a Block Tutorial – npm errors’ is closed to new replies.