Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • mscheib
    Participant

    Hey Zac,
    can you please tell me, where you updated the package-lock.json?
    Do you change this one:
    https://github.com/zgordon/how-to-gutenberg-plugin/blob/master/package-lock.json
    or that one:
    https://github.com/zgordon/gutenberg-course/blob/v2/jsforwp-example-blocks/package-lock.json

    I tryed both but can´t see a diffrent result.

    mscheib
    Participant

    Hey Zac,
    how are you?
    Do you have a idea, what I can try to get it work? I have no new idea :-/

    Thanks a lot.

    mscheib
    Participant

    Hey Zac,
    I tried as you said. But same problems.
    I run npm install. A folder “node_modules” with subfolder “etc” was created. But both are empty.
    npm run dev leads to following output:

    > jsforwp-blocks@1.0.0 dev C:\***\how-to-gutenberg-plugin-master
    > cross-env BABEL_ENV=default webpack --watch
    
    Der Befehl "cross-env" ist entweder falsch geschrieben oder
    konnte nicht gefunden werden.
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! jsforwp-blocks@1.0.0 dev: <code>cross-env BABEL_ENV=default webpack --watch</code>
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the jsforwp-blocks@1.0.0 dev script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\***\AppData\Roaming\npm-cache\_logs\2018-07-18T15_51_38_050Z-debug.log

    This is the Content of the debug.log

    0 info it worked if it ends with ok
    1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
    1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
    1 verbose cli   'run',
    1 verbose cli   'dev' ]
    2 info using npm@5.6.0
    3 info using node@v8.11.3
    4 verbose run-script [ 'predev', 'dev', 'postdev' ]
    5 info lifecycle jsforwp-blocks@1.0.0~predev: jsforwp-blocks@1.0.0
    6 info lifecycle jsforwp-blocks@1.0.0~dev: jsforwp-blocks@1.0.0
    7 verbose lifecycle jsforwp-blocks@1.0.0~dev: unsafe-perm in lifecycle true
    8 verbose lifecycle jsforwp-blocks@1.0.0~dev: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\zeug\how-to-gutenberg-plugin-master\node_modules\.bin;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\nodejs\;C:\Users\ScheibMadm\AppData\Roaming\npm;C:\Users\ScheibMadm\AppData\Local\atom\bin
    9 verbose lifecycle jsforwp-blocks@1.0.0~dev: CWD: C:\***\how-to-gutenberg-plugin-master
    10 silly lifecycle jsforwp-blocks@1.0.0~dev: Args: [ '/d /s /c', 'cross-env BABEL_ENV=default webpack --watch' ]
    11 silly lifecycle jsforwp-blocks@1.0.0~dev: Returned: code: 1  signal: null
    12 info lifecycle jsforwp-blocks@1.0.0~dev: Failed to exec dev script
    13 verbose stack Error: jsforwp-blocks@1.0.0 dev: <code>cross-env BABEL_ENV=default webpack --watch</code>
    13 verbose stack Exit status 1
    13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:285:16)
    13 verbose stack     at emitTwo (events.js:126:13)
    13 verbose stack     at EventEmitter.emit (events.js:214:7)
    13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
    13 verbose stack     at emitTwo (events.js:126:13)
    13 verbose stack     at ChildProcess.emit (events.js:214:7)
    13 verbose stack     at maybeClose (internal/child_process.js:925:16)
    13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
    14 verbose pkgid jsforwp-blocks@1.0.0
    15 verbose cwd C:\zeug\how-to-gutenberg-plugin-master
    16 verbose Windows_NT 6.1.7601
    17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "run" "dev"
    18 verbose node v8.11.3
    19 verbose npm  v5.6.0
    20 error code ELIFECYCLE
    21 error errno 1
    22 error jsforwp-blocks@1.0.0 dev: <code>cross-env BABEL_ENV=default webpack --watch</code>
    22 error Exit status 1
    23 error Failed at the jsforwp-blocks@1.0.0 dev script.
    23 error This is probably not a problem with npm. There is likely additional logging output above.
    24 verbose exit [ 1, true ]

    I’ve checked the npm- and the node-Version:
    npm: 5.6.0
    node: v8.11.3

    I work with a windows 7 PC but have the same problems with a windows 10 PC.

    Thanks a lot.

    mscheib
    Participant

    Hey Zac,
    thank you for your patience. As you said I do the following:
    a.) I install nodejs on my PC
    b.) I make a local WordPress-installation
    c.) I download the Plugin from github (again), install and activate it

    And now the following thinks happened:
    1.) When I try your Example-Blocks on my local WordPress-installation, the only working Block is the “Static Block”. The other Blocks show following error “This block has encountered an error and cannot be previewed.”
    2.) On Atom I open the Plugin-Folder (the folder with the package.json in it) and try “npm install”. Than I get the following code:

    PS C:\Wordpress\apps\wordpress\htdocs\wp-content\plugins\jsforwp-example-blocks> npm install
    npm WARN jsforwp-blocks@1.0.0 No description
    npm WARN jsforwp-blocks@1.0.0 No repository field.
    
    up to date in 1.098s
    PS C:\Wordpress\apps\wordpress\htdocs\wp-content\plugins\jsforwp-example-blocks>

    Because of the missing description and repository field in the package.json , I add these fields manually.
    After this I try “npm run dev” and get the following errors:

    jsforwp-blocks@1.0.0 dev C:\Wordpress\apps\wordpress\htdocs\wp-content\plugins\jsforwp-example-blocks
    > cross-env BABEL_ENV=default webpack --watch
    
    Der Befehl "cross-env" ist entweder falsch geschrieben oder
    konnte nicht gefunden werden. (The command "cross-env" is not written correctly or couldn´t be found.)
    
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! jsforwp-blocks@1.0.0 dev: <code>cross-env BABEL_ENV=default webpack --watch</code>
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the jsforwp-blocks@1.0.0 dev script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm WARN Local package.json exists, but node_modules missing, did you mean to install?

    Thanks for your help.

    mscheib
    Participant

    Hi Zac,
    thank you for your answer 🙂 In the last days I learned lots of basics about the work with nodejs and react.
    I installed a local WP-Server and getting nodejs run. Because I´m working from a preconfigured PC form my company, I have some problems by installing thinks. Whe I installed nodejs, the setup haven´t set the environment variable. That was the main problem.

    Now I have nodejs in version 5.6.0 running. But when I try to install npm in the plugin I get these errors:

    jsforwp-example-blocks> npm install
    npm WARN jsforwp-blocks@1.0.0 No description
    npm WARN jsforwp-blocks@1.0.0 No repository field.

    I read these forum-post https://javascriptforwp.com/forums/topic/warnings-errors-on-npm-install-and-npm-run-dev/ but not really understand anything at all. Did you get a “best practice way” to fix this problem?

    thanks a lot for your help.

Viewing 5 posts - 1 through 5 (of 5 total)