Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors on fresh install with wordpress script #37

Open
Elschnuppero opened this issue Aug 25, 2020 · 5 comments
Open

Errors on fresh install with wordpress script #37

Elschnuppero opened this issue Aug 25, 2020 · 5 comments

Comments

@Elschnuppero
Copy link

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! todo-list@0.1.0 blockbook:start: `blockbook start`
npm ERR! Exit status 1


But maybe i just made a mistake somewhere.

@claytoncollie
Copy link

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

'NODE_ENV=' + ( myArgs[ 0 ] === 'start' ? 'development' : 'production' );

NODE_ENV=development

@youknowriad
Copy link
Owner

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

@Elschnuppero
Copy link
Author

Sure. Here you go.

todo-list.zip

@pjsachdev
Copy link

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

@Elschnuppero
Copy link
Author

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

Nope, sry. Didnt pick it up again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants