ahmadawais / create-guten-block

📦 A zero-configuration #0CJS developer toolkit for building WordPress Gutenberg block plugins.
https://Awais.dev/cgb-post
MIT License
3.16k stars 326 forks source link

cgb-scripts is not recognized #162

Open stmarytx opened 5 years ago

stmarytx commented 5 years ago

Bug Report

Expected Behavior

Expected: I can create a block (in a local install, in the command line, browse to /wp-content/plugins/ and use "npx create-guten-block any-block"), make edits to block.js, and shut down my computer. When I turn the computer back on a day or two later, go to my project folder in the command line again, and use "npm start" NPM should watch for changes and compile.

Actual Behavior

Actual: After typing "npm start" I get an error:

npm-start

If I run "npm audit" it shows a high severity vulnerability for node-sass:

npm-audit

Steps to Reproduce

  1. In a local install, in the command line, browse to /wp-content/plugins/ and use "npx create-guten-block any-block", "cd any-block", and "npm start"

  2. Make changes to src/block/block.js

  3. In the command line, "control C"

  4. A day later, in the command line, return to the plugin folder /wp-content/plugins/any-block/ and use "npm start" (For some reason, once you run "npm install" if you stop watching changes and return to watching changes fairly quickly, the error does not occur. It seems to occur when new packages are available.)

I used to have Node and NPM installed globally so I uninstalled them from the global location and am only running from my local plugin folder now. Happy to offer any other details that would help reproduce and diagnose the issue.

  1. node -v: 8.12.0
  2. npm -v: 6.4.1
  3. yarn --version (if you use Yarn): N/A
  4. npm ls cgb-scripts (if you haven’t ejected): I have not ejected. Here is the error I get from the project folder:

npm-ls-cgb-scripts

Then, specify:

  1. Operating system: Windows 10 (using Git cmd for command line)
  2. Browser and version (if relevant): N/A
AlchemyUnited commented 5 years ago

I'm also on Win 10 and just got the same error.

ahmadawais commented 5 years ago

@asharirfan can you look into this? node-sass update is required.