blockbook icon indicating copy to clipboard operation
blockbook copied to clipboard

Errors on fresh install with wordpress script

Open Elschnuppero opened this issue 4 years ago • 5 comments

Hi there,

i tried to make it work with the wordpress script package, but it just gave me some errors:

In my blockbook index.js i got:

// It's important to import the JS code that registers your block in the @wordpress/blocks package
import './src/index.js';

// You should also import the stylesheets (editor and style) of your blocks.
// import './src/editor.scss';
// import './src/style.scss';

// Once your blocks are loaded, make sure to tell BlockBook to add them to the menu.
import { registerBlockType } from 'blockbook-api';

registerBlockType( 'create-block/todo-list' );

The error:

> blockbook start

Der Befehl "NODE_ENV" ist entweder falsch geschrieben oder
konnte nicht gefunden werden.
child_process.js:669
    throw err;
    ^

Error: Command failed: NODE_ENV=development C:\laragon\www\custom\wp-content\plugins\todo-list\node_modules\webpack-dev-server\bin\webpack-dev-server.js --open C:\laragon\www\custom\wp-content\plugins\todo-list\node_modules\blockbook-cli\src\app\index.js --config C:\laragon\www\custom\wp-content\plugins\todo-list\node_modules\blockbook-cli\src\cli\webpack.config.js
    at checkExecSyncError (child_process.js:630:11)
    at execSync (child_process.js:666:15)
    at Object.<anonymous> (C:\laragon\www\custom\wp-content\plugins\todo-list\node_modules\blockbook-cli\src\cli\index.js:36:1)
    at Module._compile (internal/modules/cjs/loader.js:1138:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1158:10)
    at Module.load (internal/modules/cjs/loader.js:986:32)
    at Function.Module._load (internal/modules/cjs/loader.js:879:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
    at internal/main/run_main_module.js:17:47 {
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 5932,
  stdout: null,
  stderr: null
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] blockbook:start: `blockbook start`
npm ERR! Exit status 1


But maybe i just made a mistake somewhere.

Elschnuppero avatar Aug 25 '20 17:08 Elschnuppero

You might need to add a .env file to your plugin to define the environment you are working in? This seems to be about webpack running properly. Although this line makes me think if it is not defined, then it defaults to development

https://github.com/youknowriad/blockbook/blob/e3a2d725573cda65caf4bc7f7db59522dbe35f61/src/cli/index.js#L12

NODE_ENV=development

claytoncollie avatar Aug 25 '20 17:08 claytoncollie

Mmm! weird error. Do you think you can share a zip or a link to your project/branch?

youknowriad avatar Aug 26 '20 09:08 youknowriad

Sure. Here you go.

todo-list.zip

Elschnuppero avatar Aug 30 '20 10:08 Elschnuppero

I'm also encountering this issue on Windows. Did you manage to solve the issue @Elschnuppero ?

pjsachdev avatar Oct 23 '20 13:10 pjsachdev

I'm also encountering this issue on Windows. Did you manage to solve the issue @Elschnuppero ?

Nope, sry. Didnt pick it up again.

Elschnuppero avatar Oct 23 '20 13:10 Elschnuppero