Skip to content

Create block tutorial does not work #51590

@MarHerUMR

Description

@MarHerUMR

Description

I really hope this is the right place. If not please tell me where to post about it.

I tried to follow the Create block tutorial but the first npx step fails.

Is there anything I'm missing?

Step-by-step reproduction instructions

  1. Install node, npm, WordPress
  2. Got to the plugin folder
  3. Call npx @wordpress/create-block gutenpride --template @wordpress/create-block-tutorial-template

Screenshots, screen recording, code snippet

npx @wordpress/create-block gutenpride --template @wordpress/create-block-tutorial-template
npx: installed 126 in 19.361s

Downloading template files. It might take some time...

Creating a new WordPress plugin in the gutenpride directory.

Creating a "block.json" file.

Creating a "package.json" file.

Installing `@wordpress/scripts` package. It might take a couple of minutes...
(node:4760) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 254: npm install @wordpress/scripts --save-dev
npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^2.3.2 (node_modules/jest-haste-map/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN tsutils@3.21.0 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.
npm WARN gutenpride@0.1.0 No repository field.

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /srv/www/hessenhub/public_html/wp-content/plugins/gutenpride/node_modules/jest/node_modules/jest-cli/package.json.2775365940
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open '/srv/www/hessenhub/public_html/wp-content/plugins/gutenpride/node_modules/jest/node_modules/jest-cli/package.json.2775365940'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2023-06-16T14_39_50_745Z-debug.log
    at makeError (/home/vagrant/.npm/_npx/4760/lib/node_modules/@wordpress/create-block/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/vagrant/.npm/_npx/4760/lib/node_modules/@wordpress/create-block/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at async module.exports (/home/vagrant/.npm/_npx/4760/lib/node_modules/@wordpress/create-block/lib/init-wp-scripts.js:19:2)
    at async module.exports (/home/vagrant/.npm/_npx/4760/lib/node_modules/@wordpress/create-block/lib/scaffold.js:140:4)
    at async Command.<anonymous> (/home/vagrant/.npm/_npx/4760/lib/node_modules/@wordpress/create-block/lib/index.js:120:6)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:4760) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Environment info

$ wp core version
6.0.2
$ node -v
v14.21.3
$ npx -v
6.14.18
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions