dgwyer / create-wp-block

NodeJs CLI application to generate WordPress blocks
MIT License
17 stars 0 forks source link

Error when creating a new block #20

Open anargiris opened 1 year ago

anargiris commented 1 year ago

I've been working the last week with your package and works perfectly. Today (March 16th 2023), I tried to create a new block and got the following error:

Formatting JavaScript files.
    at makeError (file:///C:/Users/anarg/AppData/Local/npm-cache/_npx/bab405a38ec78caa/node_modules/execa/lib/error.js:59:11)
    at handlePromise (file:///C:/Users/anarg/AppData/Local/npm-cache/_npx/bab405a38ec78caa/node_modules/execa/index.js:119:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async file:///C:/Users/anarg/AppData/Local/npm-cache/_npx/bab405a38ec78caa/node_modules/create-wp-block/index.js:82:20 {
  shortMessage: 'Command failed with exit code 1: npx @wordpress/create-block testblock -t tw-block',
  command: 'npx @wordpress/create-block testblock -t tw-block',
  escapedCommand: 'npx "@wordpress/create-block" testblock -t tw-block',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: '\n' +
    'Downloading template files. It might take some time...\n' +
    '\n' +
    'Creating a new WordPress plugin in the testblock directory.\n' +
    '\n' +
    'Creating a "block.json" file.\n' +
    '\n' +
    'Creating a "package.json" file.\n' +
    '\n' +
    'Installing npm devDependencies. It might take a couple of minutes...\n' +
    '\n' +
    '    at async Command.<anonymous> (C:\\Users\\anarg\\AppData\\Local\\npm-cache\\_npx\\0890e296436e9575\\node_modules\\@wordpress\\create-block\\lib\\index.js:120:6) {\r\n' +
    "  shortMessage: 'Command failed with exit code 1: npm run format',\r\n" +
    "  command: 'npm run format',\r\n" +
    '  exitCode: 1,\r\n' +
    '  signal: undefined,\r\n' +
    '  signalDescription: undefined,\r\n' +
    "  stdout: '\\n> testblock@0.1.0 format\\n> wp-scripts format\\n',\r\n" +
    `  stderr: "'wp-scripts' is not recognized as an internal or external command,\\r\\n" +\r\n` +
    "    'operable program or batch file.',\r\n" +
    '  failed: true,\r\n' +
    '  timedOut: false,\r\n' +
    '  isCanceled: false,\r\n' +
    '  killed: false\r\n' +
    '}',
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

The error must be the "wp-scripts" is not recognized etc...

The package seemed to successfully install wp-scripts though, so I am dropping this here in case someone has a solution or came up with a similar problem.