WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.55k stars 4.22k forks source link

Create block tutorial does not work #51590

Open MarHerUMR opened 1 year ago

MarHerUMR commented 1 year ago

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

t-hamano commented 1 year ago

@MarHerUMR

Thanks for the report.

Unfortunately, I have not been able to reproduce this problem. Here is the environment at the time of testing:

Could you test the following to narrow down the problem?

No template specified

npx @wordpress/create-block gutenpride

Install scripts only

npm init (all yes)
npm install @wordpress/scripts --save-dev
bph commented 1 year ago

The script performed as expected.

MarHerUMR commented 1 year ago

Thank you for your quick replies. Here the steps I took. The debug log is attached at the end. I hope this helps.

$ npx @wordpress/create-block gutenpride
npx: installed 126 in 22.536s

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:3172) 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.412725446
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.412725446'
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-20T09_18_22_379Z-debug.log
    at makeError (/home/vagrant/.npm/_npx/3172/lib/node_modules/@wordpress/create-block/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/vagrant/.npm/_npx/3172/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/3172/lib/node_modules/@wordpress/create-block/lib/init-wp-scripts.js:19:2)
    at async module.exports (/home/vagrant/.npm/_npx/3172/lib/node_modules/@wordpress/create-block/lib/scaffold.js:140:4)
    at async Command.<anonymous> (/home/vagrant/.npm/_npx/3172/lib/node_modules/@wordpress/create-block/lib/index.js:120:6)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:3172) 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:3172) [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.
$ cd gutenpride/
$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.

See `npm help init` for definitive documentation on these fields
and exactly what they do.

Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.

Press ^C at any time to quit.
package name: (gutenpride) 
version: (0.1.0) 
git repository: 
keywords: 
license: (GPL-2.0-or-later) 
About to write to /srv/www/hessenhub/public_html/wp-content/plugins/gutenpride/package.json:

{
  "name": "gutenpride",
  "version": "0.1.0",
  "description": "Example block scaffolded with Create Block tool.",
  "author": "The WordPress Contributors",
  "license": "GPL-2.0-or-later",
  "main": "build/index.js",
  "scripts": {
    "build": "wp-scripts build",
    "format": "wp-scripts format",
    "lint:css": "wp-scripts lint-style",
    "lint:js": "wp-scripts lint-js",
    "packages-update": "wp-scripts packages-update",
    "plugin-zip": "wp-scripts plugin-zip",
    "start": "wp-scripts start"
  },
  "dependencies": {
    "acorn": "^8.9.0",
    "acorn-import-assertions": "^1.9.0",
    "acorn-globals": "^7.0.1",
    "acorn-jsx": "^5.3.2",
    "acorn-walk": "^8.2.0",
    "agent-base": "^6.0.2",
    "ajv": "^6.12.6",
    "ajv-errors": "^1.0.1",
    "ajv-keywords": "^3.5.2",
    "ansi-escapes": "^4.3.2",
    "ajv-formats": "^2.1.1",
    "abab": "^2.0.6",
    "accepts": "^1.3.8",
    "ansi-html-community": "^0.0.8",
    "ansi-styles": "^3.2.1",
    "anymatch": "^3.1.3",
    "aria-query": "^5.2.1",
    "arr-union": "^3.1.0",
    "array-buffer-byte-length": "^1.0.0",
    "array-flatten": "^2.1.2",
    "array-includes": "^3.1.6",
    "array-uniq": "^1.0.3",
    "array-union": "^2.1.0",
    "array.prototype.flatmap": "^1.3.1",
    "array.prototype.flat": "^1.3.1",
    "ast-types-flow": "^0.0.7",
    "ansi-regex": "^5.0.1",
    "array.prototype.tosorted": "^1.1.1",
    "asynckit": "^0.4.0",
    "astral-regex": "^2.0.0",
    "available-typed-arrays": "^1.0.5",
    "axe-core": "^4.7.2",
    "autoprefixer": "^10.4.14",
    "axios": "^0.25.0",
    "babel-jest": "^29.5.0",
    "axobject-query": "^3.2.1",
    "babel-plugin-istanbul": "^6.1.1",
    "babel-plugin-jest-hoist": "^29.5.0",
    "babel-plugin-polyfill-corejs2": "^0.4.3",
    "babel-preset-current-node-syntax": "^1.0.1",
    "babel-plugin-polyfill-corejs3": "^0.8.1",
    "babel-plugin-polyfill-regenerator": "^0.5.0",
    "balanced-match": "^1.0.2",
    "babel-preset-jest": "^29.5.0",
    "big.js": "^5.2.2",
    "binary-extensions": "^2.2.0",
    "base64-js": "^1.5.1",
    "batch": "^0.6.1",
    "bl": "^4.1.0",
    "boolbase": "^1.0.0",
    "bonjour-service": "^1.1.1",
    "body-parser": "^1.20.1",
    "brace-expansion": "^1.1.11",
    "browserslist": "^4.21.9",
    "buffer": "^5.7.1",
    "braces": "^3.0.2",
    "bser": "^2.1.1",
    "buffer-from": "^1.1.2",
    "bytes": "^3.0.0",
    "callsites": "^3.1.0",
    "buffer-crc32": "^0.2.13",
    "call-bind": "^1.0.2",
    "camelcase": "^6.3.0",
    "camel-case": "^4.1.2",
    "camelcase-keys": "^6.2.2",
    "arrify": "^1.0.1",
    "caniuse-lite": "^1.0.30001505",
    "capital-case": "^1.0.4",
    "change-case": "^4.1.2",
    "caniuse-api": "^3.0.0",
    "chalk": "^4.1.2",
    "chokidar": "^3.5.3",
    "char-regex": "^1.0.2",
    "chownr": "^1.1.4",
    "chrome-trace-event": "^1.0.3",
    "ci-info": "^3.8.0",
    "cjs-module-lexer": "^1.2.3",
    "co": "^4.6.0",
    "clone-deep": "^0.2.4",
    "color-convert": "^1.9.3",
    "collect-v8-coverage": "^1.0.1",
    "color-name": "^1.1.3",
    "colorette": "^2.0.20",
    "colord": "^2.9.3",
    "commander": "^7.2.0",
    "combined-stream": "^1.0.8",
    "common-path-prefix": "^3.0.0",
    "compressible": "^2.0.18",
    "comment-parser": "^1.3.1",
    "concat-map": "^0.0.1",
    "commondir": "^1.0.1",
    "constant-case": "^3.0.4",
    "compression": "^1.7.4",
    "connect-history-api-fallback": "^2.0.0",
    "content-disposition": "^0.5.4",
    "convert-source-map": "^1.9.0",
    "content-type": "^1.0.5",
    "cookie": "^0.5.0",
    "cookie-signature": "^1.0.6",
    "core-js": "^3.31.0",
    "core-util-is": "^1.0.3",
    "core-js-compat": "^3.31.0",
    "core-js-pure": "^3.31.0",
    "cosmiconfig": "^7.1.0",
    "cross-fetch": "^3.1.5",
    "css-functions-list": "^3.1.0",
    "css-declaration-sorter": "^6.4.0",
    "css-select": "^4.3.0",
    "css-tree": "^1.1.3",
    "cssesc": "^3.0.0",
    "css-what": "^6.1.0",
    "cssnano-utils": "^3.1.0",
    "cssnano-preset-default": "^5.2.14",
    "cssom": "^0.5.0",
    "csso": "^4.2.0",
    "cssstyle": "^2.3.0",
    "csstype": "^3.1.2",
    "cwd": "^0.10.0",
    "damerau-levenshtein": "^1.0.8",
    "data-urls": "^3.0.2",
    "decamelize": "^1.2.0",
    "debug": "^4.3.4",
    "decimal.js": "^10.4.3",
    "decamelize-keys": "^1.1.1",
    "deep-extend": "^0.6.0",
    "deepmerge": "^4.3.1",
    "deep-is": "^0.1.4",
    "dedent": "^0.7.0",
    "default-gateway": "^6.0.3",
    "define-lazy-prop": "^2.0.0",
    "define-properties": "^1.2.0",
    "del": "^4.1.1",
    "delayed-stream": "^1.0.0",
    "dequal": "^2.0.3",
    "depd": "^2.0.0",
    "destroy": "^1.2.0",
    "detect-newline": "^3.1.0",
    "detect-node": "^2.1.0",
    "dir-glob": "^3.0.1",
    "devtools-protocol": "^0.0.981744",
    "diff-sequences": "^29.4.3",
    "dns-equal": "^1.0.0",
    "doctrine": "^2.1.0",
    "domhandler": "^4.3.1",
    "dom-serializer": "^1.4.1",
    "domexception": "^4.0.0",
    "dot-case": "^3.0.4",
    "domutils": "^2.8.0",
    "domelementtype": "^2.3.0",
    "electron-to-chromium": "^1.4.434",
    "dns-packet": "^5.6.0",
    "duplexer": "^0.1.2",
    "ee-first": "^1.1.1",
    "emittery": "^0.13.1",
    "emojis-list": "^3.0.0",
    "enhanced-resolve": "^5.15.0",
    "emoji-regex": "^9.2.2",
    "encodeurl": "^1.0.2",
    "end-of-stream": "^1.4.4",
    "envinfo": "^7.8.1",
    "entities": "^4.5.0",
    "error-ex": "^1.3.2",
    "error-stack-parser": "^2.1.4",
    "es-shim-unscopables": "^1.0.0",
    "es-abstract": "^1.21.2",
    "es-module-lexer": "^1.3.0",
    "es-set-tostringtag": "^2.0.1",
    "es-to-primitive": "^1.2.1",
    "escalade": "^3.1.1",
    "escape-html": "^1.0.3",
    "escape-string-regexp": "^1.0.5",
    "escodegen": "^2.0.0",
    "eslint-config-prettier": "^8.8.0",
    "eslint-module-utils": "^2.8.0",
    "eslint-plugin-jest": "^27.2.2",
    "eslint-plugin-import": "^2.27.5",
    "eslint-import-resolver-node": "^0.3.7",
    "eslint-plugin-jsx-a11y": "^6.7.1",
    "eslint-plugin-jsdoc": "^39.9.1",
    "eslint-scope": "^5.1.1",
    "eslint-plugin-react": "^7.32.2",
    "eslint-plugin-prettier": "^3.4.1",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-visitor-keys": "^2.1.0",
    "espree": "^9.5.2",
    "esquery": "^1.5.0",
    "esprima": "^4.0.1",
    "esrecurse": "^4.3.0",
    "estraverse": "^4.3.0",
    "esutils": "^2.0.3",
    "etag": "^1.8.1",
    "eventemitter3": "^4.0.7",
    "execa": "^5.1.1",
    "events": "^3.3.0",
    "exit": "^0.1.2",
    "expect": "^29.5.0",
    "expand-tilde": "^1.2.2",
    "express": "^4.18.2",
    "fast-deep-equal": "^3.1.3",
    "extract-zip": "^2.0.1",
    "fast-json-stable-stringify": "^2.1.0",
    "fast-diff": "^1.3.0",
    "fast-glob": "^3.2.12",
    "fastest-levenshtein": "^1.0.16",
    "fastq": "^1.15.0",
    "fast-levenshtein": "^2.0.6",
    "fd-slicer": "^1.1.0",
    "faye-websocket": "^0.11.4",
    "fb-watchman": "^2.0.2",
    "file-entry-cache": "^6.0.1",
    "filename-reserved-regex": "^2.0.0",
    "fill-range": "^7.0.1",
    "find-cache-dir": "^3.3.2",
    "finalhandler": "^1.2.0",
    "find-pkg": "^0.1.2",
    "find-file-up": "^0.1.3",
    "find-parent-dir": "^0.3.1",
    "find-process": "^1.4.7",
    "for-each": "^0.3.3",
    "flat-cache": "^3.0.4",
    "flatted": "^3.2.7",
    "follow-redirects": "^1.15.2",
    "for-in": "^1.0.2",
    "for-own": "^0.1.5",
    "forwarded": "^0.2.0",
    "fraction.js": "^4.2.0",
    "form-data": "^4.0.0",
    "fs-constants": "^1.0.0",
    "fresh": "^0.5.2",
    "fs-monkey": "^1.0.4",
    "fs-exists-sync": "^0.1.0",
    "function.prototype.name": "^1.1.5",
    "function-bind": "^1.1.1",
    "fs.realpath": "^1.0.0",
    "gensync": "^1.0.0-beta.2",
    "functions-have-names": "^1.2.3",
    "get-intrinsic": "^1.2.1",
    "get-stdin": "^9.0.0",
    "get-package-type": "^0.1.0",
    "get-stream": "^6.0.1",
    "get-symbol-description": "^1.0.0",
    "glob": "^7.2.3",
    "global-prefix": "^0.1.5",
    "glob-parent": "^5.1.2",
    "glob-to-regexp": "^0.4.1",
    "globals": "^11.12.0",
    "globalthis": "^1.0.3",
    "globby": "^11.1.0",
    "global-modules": "^0.2.3",
    "gopd": "^1.0.1",
    "graceful-fs": "^4.2.11",
    "globjoin": "^0.1.4",
    "grapheme-splitter": "^1.0.4",
    "graphemer": "^1.4.0",
    "hard-rejection": "^2.1.0",
    "handle-thing": "^2.0.1",
    "gzip-size": "^6.0.0",
    "has-bigints": "^1.0.2",
    "has-flag": "^3.0.0",
    "has": "^1.0.3",
    "has-property-descriptors": "^1.0.0",
    "has-proto": "^1.0.1",
    "has-tostringtag": "^1.0.0",
    "has-symbols": "^1.0.3",
    "homedir-polyfill": "^1.0.3",
    "hpack.js": "^2.1.6",
    "html-entities": "^2.3.6",
    "http-deceiver": "^1.2.7",
    "html-escaper": "^2.0.2",
    "html-tags": "^3.3.1",
    "http-parser-js": "^0.5.8",
    "http-errors": "^2.0.0",
    "http-proxy-agent": "^5.0.0",
    "http-proxy-middleware": "^2.0.6",
    "http-proxy": "^1.18.1",
    "iconv-lite": "^0.6.3",
    "https-proxy-agent": "^5.0.1",
    "icss-utils": "^5.1.0",
    "ieee754": "^1.2.1",
    "human-signals": "^2.1.0",
    "hosted-git-info": "^2.8.9",
    "immutable": "^4.3.0",
    "ignore-walk": "^4.0.1",
    "imurmurhash": "^0.1.4",
    "import-lazy": "^4.0.0",
    "ignore": "^5.2.4",
    "inherits": "^2.0.4",
    "ini": "^1.3.8",
    "import-local": "^3.1.0",
    "indent-string": "^4.0.0",
    "inflight": "^1.0.6",
    "internal-slot": "^1.0.5",
    "irregular-plurals": "^3.5.0",
    "ipaddr.js": "^2.1.0",
    "import-fresh": "^3.3.0",
    "interpret": "^2.2.0",
    "is-arrayish": "^0.2.1",
    "is-binary-path": "^2.1.0",
    "is-bigint": "^1.0.4",
    "is-boolean-object": "^1.1.2",
    "is-buffer": "^1.1.6",
    "is-core-module": "^2.12.1",
    "is-date-object": "^1.0.5",
    "is-callable": "^1.2.7",
    "is-array-buffer": "^3.0.2",
    "is-fullwidth-code-point": "^3.0.0",
    "is-extendable": "^0.1.1",
    "is-negative-zero": "^2.0.2",
    "is-number": "^7.0.0",
    "is-glob": "^4.0.3",
    "is-generator-fn": "^2.1.0",
    "is-number-object": "^1.0.7",
    "is-path-cwd": "^2.2.0",
    "is-path-in-cwd": "^2.1.0",
    "is-path-inside": "^2.1.0",
    "is-plain-obj": "^3.0.0",
    "is-plain-object": "^5.0.0",
    "is-regex": "^1.1.4",
    "is-potential-custom-element-name": "^1.0.1",
    "is-shared-array-buffer": "^1.0.2",
    "is-stream": "^2.0.1",
    "is-string": "^1.0.7",
    "is-symbol": "^1.0.4",
    "is-weakref": "^1.0.2",
    "is-unicode-supported": "^0.1.0",
    "is-typed-array": "^1.1.10",
    "is-windows": "^0.2.0",
    "isarray": "^1.0.0",
    "is-wsl": "^2.2.0",
    "isexe": "^2.0.0",
    "istanbul-lib-coverage": "^3.2.0",
    "isobject": "^3.0.1",
    "is-docker": "^2.2.1",
    "istanbul-lib-instrument": "^5.2.1",
    "istanbul-lib-report": "^3.0.0",
    "istanbul-lib-source-maps": "^4.0.1",
    "istanbul-reports": "^3.1.5",
    "jest-changed-files": "^29.5.0",
    "is-extglob": "^2.1.1",
    "jest-diff": "^29.5.0",
    "jest-each": "^29.5.0",
    "jest-environment-node": "^29.5.0",
    "jest-get-type": "^29.4.3",
    "jest-docblock": "^29.4.3",
    "jest-haste-map": "^29.5.0",
    "jest-matcher-utils": "^29.5.0",
    "jest-leak-detector": "^29.5.0",
    "jest-message-util": "^29.5.0",
    "jest-mock": "^29.5.0",
    "jest-pnp-resolver": "^1.2.3",
    "jest-resolve": "^29.5.0",
    "jest-regex-util": "^29.4.3",
    "jest-runtime": "^29.5.0",
    "jest-watcher": "^29.5.0",
    "jest-util": "^29.5.0",
    "jest-snapshot": "^29.5.0",
    "jest-validate": "^29.5.0",
    "js-tokens": "^4.0.0",
    "jest-worker": "^29.5.0",
    "jest-resolve-dependencies": "^29.5.0",
    "js-yaml": "^3.14.1",
    "jsdoc-type-pratt-parser": "^3.1.0",
    "jsesc": "^2.5.2",
    "jsdom": "^20.0.3",
    "json-schema-traverse": "^0.4.1",
    "json-parse-even-better-errors": "^2.3.1",
    "json-stable-stringify-without-jsonify": "^1.0.1",
    "json2php": "^0.0.7",
    "jsx-ast-utils": "^3.3.3",
    "jsonc-parser": "^3.0.0",
    "json5": "^2.2.3",
    "joi": "^17.9.2",
    "kind-of": "^3.2.2",
    "klona": "^2.0.6",
    "language-subtag-registry": "^0.3.22",
    "known-css-properties": "^0.26.0",
    "language-tags": "^1.0.5",
    "launch-editor": "^2.6.0",
    "lazy-cache": "^1.0.4",
    "leven": "^3.1.0",
    "levn": "^0.4.1",
    "lilconfig": "^2.1.0",
    "linkify-it": "^3.0.3",
    "lines-and-columns": "^1.2.4",
    "loader-utils": "^2.0.4",
    "loader-runner": "^4.3.0",
    "lodash.debounce": "^4.0.8",
    "lodash.merge": "^4.6.2",
    "lodash": "^4.17.21",
    "lodash.memoize": "^4.1.2",
    "lodash.uniq": "^4.5.0",
    "log-symbols": "^4.1.0",
    "kleur": "^3.0.3",
    "loose-envify": "^1.4.0",
    "lru-cache": "^5.1.1",
    "lodash.truncate": "^4.4.2",
    "header-case": "^2.0.4",
    "make-dir": "^3.1.0",
    "lower-case": "^2.0.2",
    "makeerror": "^1.0.12",
    "map-obj": "^4.3.0",
    "markdownlint": "^0.25.1",
    "markdown-it": "^12.3.2",
    "map-values": "^1.0.1",
    "markdownlint-rule-helpers": "^0.16.0",
    "mathml-tag-names": "^2.1.3",
    "mdurl": "^1.0.1",
    "memfs": "^3.5.3",
    "mdn-data": "^2.0.14",
    "media-typer": "^0.3.0",
    "meow": "^6.1.1",
    "merge-descriptors": "^1.0.1",
    "merge-stream": "^2.0.0",
    "merge2": "^1.4.1",
    "methods": "^1.1.2",
    "mime": "^1.6.0",
    "micromatch": "^4.0.5",
    "mime-types": "^2.1.35",
    "mime-db": "^1.52.0",
    "mimic-fn": "^2.1.0",
    "min-indent": "^1.0.1",
    "minimalistic-assert": "^1.0.1",
    "minimist-options": "^4.1.0",
    "minimatch": "^3.1.2",
    "minimist": "^1.2.8",
    "mixin-object": "^2.0.1",
    "mkdirp-classic": "^0.5.3",
    "mrmime": "^1.0.1",
    "natural-compare": "^1.4.0",
    "multicast-dns": "^7.2.5",
    "nanoid": "^3.3.6",
    "ms": "^2.1.2",
    "natural-compare-lite": "^1.4.0",
    "negotiator": "^0.6.3",
    "node-fetch": "^2.6.7",
    "neo-async": "^2.6.2",
    "no-case": "^3.0.4",
    "node-forge": "^1.3.1",
    "node-int64": "^0.4.0",
    "node-releases": "^2.0.12",
    "normalize-path": "^3.0.0",
    "normalize-range": "^0.1.2",
    "normalize-url": "^6.1.0",
    "normalize-package-data": "^2.5.0",
    "npm-bundled": "^1.1.2",
    "npm-run-path": "^4.0.1",
    "npm-normalize-package-bin": "^1.0.1",
    "object-filter": "^1.0.2",
    "nth-check": "^2.1.1",
    "object-inspect": "^1.12.3",
    "nwsapi": "^2.2.5",
    "object-assign": "^4.1.1",
    "object-keys": "^1.1.1",
    "object.assign": "^4.1.4",
    "object.entries": "^1.1.6",
    "obuf": "^1.1.2",
    "object.fromentries": "^2.0.6",
    "object.hasown": "^1.1.2",
    "object.values": "^1.1.6",
    "on-finished": "^2.4.1",
    "once": "^1.4.0",
    "onetime": "^5.1.2",
    "open": "^8.4.2",
    "on-headers": "^1.0.2",
    "opener": "^1.5.2",
    "optionator": "^0.9.1",
    "os-homedir": "^1.0.2",
    "p-limit": "^3.1.0",
    "p-map": "^2.1.0",
    "param-case": "^3.0.4",
    "p-retry": "^4.6.2",
    "p-try": "^2.2.0",
    "parse-passwd": "^1.0.0",
    "parse-json": "^5.2.0",
    "parent-module": "^1.0.1",
    "parse5": "^7.1.2",
    "parseurl": "^1.3.3",
    "path-case": "^3.0.4",
    "pascal-case": "^3.1.2",
    "path-exists": "^4.0.0",
    "path-is-inside": "^1.0.2",
    "path-is-absolute": "^1.0.1",
    "path-parse": "^1.0.7",
    "path-to-regexp": "^0.1.7",
    "path-key": "^3.1.1",
    "path-type": "^4.0.0",
    "pend": "^1.2.0",
    "pinkie": "^2.0.4",
    "picocolors": "^1.0.0",
    "picomatch": "^2.3.1",
    "pify": "^4.0.1",
    "pirates": "^4.0.6",
    "pkg-dir": "^4.2.0",
    "postcss": "^8.4.24",
    "plur": "^4.0.0",
    "postcss-calc": "^8.2.4",
    "pinkie-promise": "^2.0.1",
    "postcss-colormin": "^5.3.1",
    "postcss-discard-duplicates": "^5.1.0",
    "postcss-convert-values": "^5.1.3",
    "postcss-discard-comments": "^5.1.2",
    "postcss-discard-empty": "^5.1.1",
    "postcss-media-query-parser": "^0.2.3",
    "postcss-discard-overridden": "^5.1.0",
    "postcss-merge-rules": "^5.1.4",
    "postcss-merge-longhand": "^5.1.7",
    "postcss-minify-font-values": "^5.1.0",
    "postcss-minify-gradients": "^5.1.1",
    "postcss-minify-params": "^5.1.4",
    "postcss-minify-selectors": "^5.2.1",
    "postcss-modules-local-by-default": "^4.0.3",
    "postcss-modules-extract-imports": "^3.0.0",
    "postcss-modules-scope": "^3.0.0",
    "postcss-normalize-charset": "^5.1.0",
    "postcss-modules-values": "^4.0.0",
    "postcss-normalize-display-values": "^5.1.0",
    "postcss-normalize-positions": "^5.1.1",
    "postcss-normalize-string": "^5.1.0",
    "postcss-normalize-repeat-style": "^5.1.1",
    "postcss-normalize-timing-functions": "^5.1.0",
    "postcss-normalize-unicode": "^5.1.1",
    "postcss-ordered-values": "^5.1.3",
    "postcss-normalize-whitespace": "^5.1.1",
    "postcss-normalize-url": "^5.1.0",
    "postcss-reduce-initial": "^5.1.2",
    "postcss-safe-parser": "^6.0.0",
    "postcss-resolve-nested-selector": "^0.1.1",
    "postcss-reduce-transforms": "^5.1.0",
    "postcss-scss": "^4.0.6",
    "postcss-selector-parser": "^6.0.13",
    "postcss-svgo": "^5.1.0",
    "postcss-value-parser": "^4.2.0",
    "prelude-ls": "^1.2.1",
    "postcss-unique-selectors": "^5.1.1",
    "prettier-linter-helpers": "^1.0.0",
    "process-nextick-args": "^2.0.1",
    "progress": "^2.0.3",
    "pretty-format": "^29.5.0",
    "prompts": "^2.4.2",
    "prop-types": "^15.8.1",
    "proxy-addr": "^2.0.7",
    "proxy-from-env": "^1.1.0",
    "psl": "^1.9.0",
    "pseudomap": "^1.0.2",
    "punycode": "^2.3.0",
    "pure-rand": "^6.0.2",
    "pump": "^3.0.0",
    "qs": "^6.11.0",
    "querystringify": "^2.2.0",
    "quick-lru": "^4.0.1",
    "randombytes": "^2.1.0",
    "queue-microtask": "^1.2.3",
    "range-parser": "^1.2.1",
    "react": "^18.2.0",
    "raw-body": "^2.5.1",
    "react-dom": "^18.2.0",
    "react-is": "^16.13.1",
    "read-pkg-up": "^7.0.1",
    "readable-stream": "^3.6.2",
    "read-pkg": "^5.2.0",
    "readdirp": "^3.6.0",
    "redent": "^3.0.0",
    "rechoir": "^0.7.1",
    "regenerate": "^1.4.2",
    "regenerate-unicode-properties": "^10.1.0",
    "regenerator-transform": "^0.15.1",
    "regenerator-runtime": "^0.13.11",
    "regexp.prototype.flags": "^1.5.0",
    "regexpu-core": "^5.3.2",
    "require-from-string": "^2.0.2",
    "requireindex": "^1.2.0",
    "regjsparser": "^0.9.1",
    "requires-port": "^1.0.0",
    "resolve": "^1.22.2",
    "resolve-cwd": "^3.0.0",
    "resolve-dir": "^0.1.1",
    "resolve-from": "^4.0.0",
    "resolve.exports": "^2.0.2",
    "retry": "^0.13.1",
    "reusify": "^1.0.4",
    "rimraf": "^2.7.1",
    "run-con": "^1.2.12",
    "rxjs": "^7.8.1",
    "run-parallel": "^1.2.0",
    "safe-buffer": "^5.2.1",
    "safe-regex-test": "^1.0.0",
    "safer-buffer": "^2.1.2",
    "scheduler": "^0.23.0",
    "saxes": "^6.0.0",
    "schema-utils": "^3.3.0",
    "selfsigned": "^2.1.1",
    "select-hose": "^2.0.0",
    "send": "^0.18.0",
    "semver": "^6.3.0",
    "serialize-javascript": "^6.0.1",
    "sentence-case": "^3.0.4",
    "serve-static": "^1.15.0",
    "shallow-clone": "^0.1.2",
    "serve-index": "^1.9.1",
    "setprototypeof": "^1.2.0",
    "shebang-command": "^1.2.0",
    "shebang-regex": "^1.0.0",
    "shell-quote": "^1.8.1",
    "side-channel": "^1.0.4",
    "sirv": "^1.0.19",
    "signal-exit": "^3.0.7",
    "sisteransi": "^1.0.5",
    "snake-case": "^3.0.4",
    "slash": "^3.0.0",
    "slice-ansi": "^4.0.0",
    "source-map": "^0.7.4",
    "source-map-js": "^1.0.2",
    "sockjs": "^0.3.24",
    "source-map-support": "^0.5.13",
    "spawnd": "^6.2.0",
    "spdx-exceptions": "^2.3.0",
    "spdx-license-ids": "^3.0.13",
    "spdx-correct": "^3.2.0",
    "spdx-expression-parse": "^3.0.1",
    "spdy": "^4.0.2",
    "spdy-transport": "^3.0.0",
    "sprintf-js": "^1.0.3",
    "stackframe": "^1.3.4",
    "stable": "^0.1.8",
    "stack-utils": "^2.0.6",
    "statuses": "^2.0.1",
    "string-length": "^4.0.2",
    "string-width": "^4.2.3",
    "string.prototype.matchall": "^4.0.8",
    "string.prototype.trimstart": "^1.0.6",
    "string.prototype.trim": "^1.2.7",
    "string.prototype.trimend": "^1.0.6",
    "strip-final-newline": "^2.0.0",
    "strip-ansi": "^6.0.1",
    "string_decoder": "^1.3.0",
    "strip-bom": "^3.0.0",
    "strip-indent": "^3.0.0",
    "strip-json-comments": "^3.1.1",
    "strip-outer": "^1.0.1",
    "style-search": "^0.1.0",
    "stylehacks": "^5.1.1",
    "stylelint-config-recommended": "^6.0.0",
    "stylelint-config-recommended-scss": "^5.0.2",
    "stylelint-scss": "^4.7.0",
    "supports-color": "^5.5.0",
    "supports-hyperlinks": "^2.3.0",
    "supports-preserve-symlinks-flag": "^1.0.0",
    "svg-parser": "^2.0.4",
    "svg-tags": "^1.0.0",
    "svgo": "^2.8.0",
    "table": "^6.8.1",
    "symbol-tree": "^3.2.4",
    "tar-fs": "^2.1.1",
    "tapable": "^2.2.1",
    "tar-stream": "^2.2.0",
    "terser-webpack-plugin": "^5.3.9",
    "terser": "^5.18.1",
    "test-exclude": "^6.0.0",
    "text-table": "^0.2.0",
    "through": "^2.3.8",
    "tmpl": "^1.0.5",
    "thunky": "^1.1.0",
    "to-regex-range": "^5.0.1",
    "to-fast-properties": "^2.0.0",
    "toidentifier": "^1.0.1",
    "tough-cookie": "^4.1.3",
    "totalist": "^1.1.0",
    "tr46": "^3.0.0",
    "trim-newlines": "^3.0.1",
    "tree-kill": "^1.2.2",
    "tsconfig-paths": "^3.14.2",
    "trim-repeated": "^1.0.0",
    "tsutils": "^3.21.0",
    "tslib": "^2.5.3",
    "type-check": "^0.4.0",
    "type-is": "^1.6.18",
    "type-detect": "^4.0.8",
    "type-fest": "^0.20.2",
    "uc.micro": "^1.0.6",
    "typed-array-length": "^1.0.4",
    "unbzip2-stream": "^1.4.3",
    "unbox-primitive": "^1.0.2",
    "unicode-match-property-ecmascript": "^2.0.0",
    "unicode-canonical-property-names-ecmascript": "^2.0.0",
    "unicode-property-aliases-ecmascript": "^2.1.0",
    "universalify": "^0.2.0",
    "unicode-match-property-value-ecmascript": "^2.1.0",
    "unpipe": "^1.0.0",
    "upper-case": "^2.0.2",
    "update-browserslist-db": "^1.0.11",
    "upper-case-first": "^2.0.2",
    "uri-js": "^4.4.1",
    "url-parse": "^1.5.10",
    "utils-merge": "^1.0.1",
    "util-deprecate": "^1.0.2",
    "uuid": "^8.3.2",
    "v8-compile-cache": "^2.3.0",
    "validate-npm-package-license": "^3.0.4",
    "v8-to-istanbul": "^9.1.0",
    "vary": "^1.1.2",
    "w3c-xmlserializer": "^4.0.0",
    "wait-on": "^6.0.1",
    "watchpack": "^2.4.0",
    "wbuf": "^1.7.3",
    "walker": "^1.0.8",
    "webidl-conversions": "^7.0.0",
    "webpack-merge": "^5.9.0",
    "webpack-dev-middleware": "^5.3.3",
    "webpack-sources": "^3.2.3",
    "websocket-driver": "^0.7.4",
    "whatwg-encoding": "^2.0.0",
    "websocket-extensions": "^0.1.4",
    "whatwg-url": "^11.0.0",
    "whatwg-mimetype": "^3.0.0",
    "which": "^1.3.1",
    "which-boxed-primitive": "^1.0.2",
    "which-typed-array": "^1.1.9",
    "wildcard": "^2.0.1",
    "wrappy": "^1.0.2",
    "word-wrap": "^1.2.3",
    "write-file-atomic": "^4.0.2",
    "xmlchars": "^2.2.0",
    "yallist": "^3.1.1",
    "xml-name-validator": "^4.0.0",
    "argparse": "^1.0.10",
    "ws": "^8.13.0",
    "html-encoding-sniffer": "^3.0.0",
    "yauzl": "^2.10.0",
    "yaml": "^1.10.2",
    "yocto-queue": "^0.1.0"
  },
  "devDependencies": {}
}

Is this OK? (yes) 
$ npm install @wordpress/scripts --save-dev
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.2212698240
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.2212698240'
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-20T09_21_12_302Z-debug.log

2023-06-20T09_21_12_302Z-debug.log

t-hamano commented 1 year ago

Thank you for sending the logs.

It looks like the same error occurs when I install @wordpress/scripts directly.

The critical error is this:

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.2212698240
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.2212698240'

Therefore, this is probably not a problem with create-block package but is directly caused by the scripts package.

I regret that I'm unable to reproduce this issue, but the following actions may be effective.

MarHerUMR commented 1 year ago

I cleared the cache and removed the gutenpride folder. But with the same result

$ npm cache clean --force
npm WARN using --force I sure hope you know what you are doing.
$ rm -rf gutenpride/
$ npx @wordpress/create-block gutenpride --template @wordpress/create-block-tutorial-template
npx: installed 126 in 22.172s

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:4339) 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.3874038335
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.3874038335'
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-20T11_28_13_145Z-debug.log
    at makeError (/home/vagrant/.npm/_npx/4339/lib/node_modules/@wordpress/create-block/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/home/vagrant/.npm/_npx/4339/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/4339/lib/node_modules/@wordpress/create-block/lib/init-wp-scripts.js:19:2)
    at async module.exports (/home/vagrant/.npm/_npx/4339/lib/node_modules/@wordpress/create-block/lib/scaffold.js:140:4)
    at async Command.<anonymous> (/home/vagrant/.npm/_npx/4339/lib/node_modules/@wordpress/create-block/lib/index.js:120:6)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4339) 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:4339) [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.

The jest folder seems to be missing in the node_modules folder after the installation. The only folder with jest has a leading @ symbol.

$ ls gutenpride/node_modules/ | grep "jest"
babel-jest
babel-plugin-jest-hoist
babel-preset-jest
eslint-plugin-jest
@jest
jest-changed-files
jest-circus
jest-config
jest-dev-server
jest-diff
jest-docblock
jest-each
jest-environment-jsdom
jest-environment-node
jest-get-type
jest-haste-map
jest-leak-detector
jest-matcher-utils
jest-message-util
jest-mock
jest-pnp-resolver
jest-regex-util
jest-resolve
jest-resolve-dependencies
jest-runner
jest-runtime
jest-snapshot
jest-util
jest-validate
jest-watcher
jest-worker

Is there anything else I should try?

t-hamano commented 1 year ago

This stackoverflow article might be helpful, but I am not very confident that these approaches are ideal.

https://stackoverflow.com/questions/56103865/how-to-fix-unsupported-platform-for-fsevents1-2-9-wanted-osdarwin-arch

For more professional feedback, I'll give them the Needs technical feedback label.

dashkevych commented 5 months ago

I have a similar issue regarding the create-block tutorial. Specifically, Quick Start section.

I use the following commands to create a demo block:

  1. npx @wordpress/create-block@latest todo-list
  2. cd todo-list
  3. npm start

It goes fine, without any issues. However, the block is not shown in the Editor. Even though:

  1. The plugin is activated.
  2. I use a fresh WordPress installation (via LocalWP), no additional plugins.

I tried it on both machines: Windows and Mac.

ndiego commented 5 months ago

~Hi @dashkevych, are you seeing any errors in the console when in the Editor?~

It turns out there is an issue in the latest version of @wordpress/scripts (v28) is not compatible with WordPress 6.5 and lower. There is a PR to make sure the version of scripts used in the create-block package is set to v27. This PR will be included in the next package update. In the meantime, you can activate the Gutenberg plugin, and the blocks should load as expected.