create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

Command failed: npm install cgb-scripts --save --save-exact --silent

Open casperleerink opened this issue 3 years ago • 11 comments

Bug Report

Expected Behaviour

cd into wp-content/plugins

then run

npx create-guten-block my-project

It should install everything normally.

Actual Behaviour

During the installation I get the following error:

Command failed: npm install cgb-scripts --save --save-exact --silent
at makeError (/Users/casperleerink/.config/yarn/global/node_modules/execa/index.js:169:9)
    at /Users/casperleerink/.config/yarn/global/node_modules/execa/index.js:274:16
    at processTicksAndRejections (node:internal/process/task_queues:94:5)
    at async /Users/casperleerink/.config/yarn/global/node_modules/create-guten-block/app/npmInstallScripts.js:48:3 {
  code: 1,
  stdout: '',
  stderr: '',
  failed: true,
  signal: null,
  cmd: 'npm install cgb-scripts --save --save-exact --silent',
  timedOut: false,
  killed: false
}

I am running this on MacOS big sur 11.4, just normal intel chip. I am running my wordpress locally on a docker container. Tried it both with npx create-guten-block and yarn create guten-block but getting the same error.

Using node version 15.14.0 For reference here is my docker-compose.yaml

version: "3"

services:
  # Database
  db:
    image: mysql:5.7
    volumes:
      - db_data:/var/lib/mysql
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: wordpress
    networks:
      - wpsite
  # phpmyadmin
  phpmyadmin:
    depends_on:
      - db
    image: phpmyadmin/phpmyadmin
    restart: always
    ports:
      - "8080:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: password
    networks:
      - wpsite
  # Wordpress
  wordpress:
    depends_on:
      - db
    image: wordpress:latest
    ports:
      - "8000:80"
    restart: always
    volumes: ["./:/var/www/html"]
    environment:
      WORDPRESS_DB_HOST: db:3306
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: wordpress
    networks:
      - wpsite
networks:
  wpsite:
volumes:
  db_data:

casperleerink avatar Jun 06 '21 05:06 casperleerink

Getting the same error

odm275 avatar Aug 04 '21 20:08 odm275

Getting the same error too.

DaveyJake avatar Oct 08 '21 18:10 DaveyJake

Unfortunately I get the same error node v16.10.0 npm 7.24.0

Also test it with: sudo npx create-guten-block my-test-block

Pixelizer avatar Oct 27 '21 23:10 Pixelizer

I'm getting the same error. macOS Big Sur version 11.6 (new apple M1 chip). node v15.14.0 npm v7.7.6

alexrkoch avatar Nov 10 '21 20:11 alexrkoch

same here. (Mojave )

it's still working with node v14.18.1 npm 6.14.15

mamaretti avatar Nov 18 '21 21:11 mamaretti

There already have an issue and have been solved: https://github.com/ahmadawais/create-guten-block/issues/152

The solution is to change node version to v14.17.0 . At least works for me.

jiaoqiqi avatar Nov 23 '21 05:11 jiaoqiqi

try NVM manager https://github.com/nvm-sh/nvm

╭─ clvz   …/wp-content/plugins  ╰─ nvm ls  10024  14:21:46  v12.16.1 v12.18.3 v14.15.4 v14.16.1 v14.17.0 v14.17.4 -> v14.18.2 v16.13.1 system default -> node (-> v16.13.1) iojs -> N/A (default) unstable -> N/A (default) node -> stable (-> v16.13.1) (default) stable -> 16.13 (-> v16.13.1) (default) lts/* -> lts/gallium (-> v16.13.1) lts/argon -> v4.9.1 (-> N/A) lts/boron -> v6.17.1 (-> N/A) lts/carbon -> v8.17.0 (-> N/A) lts/dubnium -> v10.24.1 (-> N/A) lts/erbium -> v12.22.7 (-> N/A) lts/fermium -> v14.18.2 lts/gallium -> v16.13.1 ╭─ clvz   …/wp-content/plugins  ╰─ nvm use lts/fermium  10025  14:21:50  Now using node v14.18.2 (npm v6.14.15) ╭─ clvz   …/wp-content/plugins  ╰─

calvez avatar Jan 05 '22 13:01 calvez

Was delighted to see this npx create-guten-block my-block but unable to install, is there any thing you can do?

Robeeen avatar Jan 26 '22 15:01 Robeeen

Works for me as well on Node 14.19 using NVM

barcovanrhijn avatar Mar 24 '22 14:03 barcovanrhijn

The workaround using outdated versions of node is a poor solution. This library promises to manage dependencies for you, but the dependencies under the hood here are half a decade old and include 16 high and medium severity security issues. The library is not maintained (and never was). But since the point of the library is to simplify/hide the dependency details from users, people don't know that and wrongfully think that just running a years-old version of node to "make it work" is a solution. If you use the eject script and try to update your dependencies, you'll understand.

@ahmadawais should mark this repo as 'looking for maintainer' and/or archive it, as in this state it is actively doing harm to developers who don't know the difference, all while taking every opportunity to try to monetize.

Full reply on the original issue (which was "closed" for no apparent reason, since this issue is cross-platform and still affects anyone attempting to use this library on a remotely recent version of node): https://github.com/ahmadawais/create-guten-block/issues/152#issuecomment-1245034255

t-lock avatar Sep 14 '22 05:09 t-lock

image

This project is archived and looking for active maintainers.

Hi folks,

The create-guten-block project was a labor of love and I personally don't use it any more which is why I find less and less time to manage and improve upon it. While I'd like to think this project paved the way for other projects like wp-scripts and wp-blocks, there's value in maintaining this project.

If you're interested in improving the overall health of this project, please respond to this issue. It would require a great deal of technical insights into the WordPress ecosystem as well as JavaScript projects like webpack, React, and more.

Peace! ✌️

create-guten-block is looking for active maintianers #307 ← respond to this issue.

ahmadawais avatar Sep 14 '22 09:09 ahmadawais