phaser-es6-webpack icon indicating copy to clipboard operation
phaser-es6-webpack copied to clipboard

stack Error: [email protected] deploy: `webpack --config webpack.production.config.js`

Open boas19910115 opened this issue 6 years ago • 6 comments

I run "npm run deploy". After the build dir created in root dir, the error occured.

  • 0 info it worked if it ends with ok
  • 1 verbose cli [ 'C:\Program Files\nodejs\node.exe',
  • 1 verbose cli 'C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js',
  • 1 verbose cli 'run',
  • 1 verbose cli 'deploy' ]
  • 2 info using [email protected]
  • 3 info using [email protected]
  • 4 verbose run-script [ 'predeploy', 'deploy', 'postdeploy' ]
  • 5 info lifecycle [email protected]~predeploy: [email protected]
  • 6 info lifecycle [email protected]~deploy: [email protected]
  • 7 verbose lifecycle [email protected]~deploy: unsafe-perm in lifecycle true
  • 8 verbose lifecycle [email protected]~deploy: PATH: C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\jonanwu\yuanbao-game\three-cards-phaser\node_modules.bin;C:\jdk-8u171\bin;C:\jdk-8u171\bin;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0;C:\Program Files\nodejs;C:\Program Files\Git\cmd;C:\apache-maven-3.5.3\bin;;C:\WINDOWS\System32\OpenSSH;C:\Program Files\Microsoft VS Code\bin;C:\Go\bin;C:\Program Files\dotnet;C:\Program Files\Microsoft SQL Server\130\Tools\Binn;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Microsoft VS Code\bin;C:\Users\admin\AppData\Roaming\npm;C:\Users\admin\AppData\Local\GitHubDesktop\bin;C:\Users\admin\AppData\Local\Microsoft\WindowsApps;C:\Users\admin\AppData\Local\Google\Cloud SDK\google-cloud-sdk\bin;C:\Users\admin\go\bin
  • 9 verbose lifecycle [email protected]~deploy: CWD: C:\jonanwu\yuanbao-game\three-cards-phaser
  • 10 silly lifecycle [email protected]~deploy: Args: [ '/d /s /c', 'webpack --config webpack.production.config.js' ]
  • 11 silly lifecycle [email protected]~deploy: Returned: code: 2 signal: null
  • 12 info lifecycle [email protected]~deploy: Failed to exec deploy script

The error occur from here

- 13 verbose stack Error: [email protected] deploy: webpack --config webpack.production.config.js

  • 13 verbose stack Exit status 2
  • 13 verbose stack at EventEmitter. (C:\Users\admin\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:304: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. (C:\Users\admin\AppData\Roaming\npm\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 [email protected]
  • 15 verbose cwd C:\jonanwu\yuanbao-game\three-cards-phaser
  • 16 verbose Windows_NT 10.0.17134
  • 17 verbose argv "C:\Program Files\nodejs\node.exe" "C:\Users\admin\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "run" "deploy"
  • 18 verbose node v8.11.1
  • 19 verbose npm v6.4.0
  • 20 error code ELIFECYCLE
  • 21 error errno 2
  • 22 error [email protected] deploy: webpack --config webpack.production.config.js
  • 22 error Exit status 2
  • 23 error Failed at the [email protected] deploy script.
  • 23 error This is probably not a problem with npm. There is likely additional logging output above.
  • 24 verbose exit [ 2, true ]

I never edit files about webpack or modules. What I edit just in src.

boas19910115 avatar Oct 09 '18 03:10 boas19910115

Please, check if the file ẁebpack.producion.config.js is in the root of your project

lean avatar Oct 09 '18 13:10 lean

Please, check if the file ẁebpack.producion.config.js is in the root of your project

Yes. It exist in the root of my project. I set on hook in Jenkins.. When Jenkins run "npm run deploy" , the error make terminal stop running. Actually, despite of this error, files in the build dir are still available and running normally. So I change the command into "npm run deploy || true" to ignore the error. I just worry this error will possibly make some problem in the future.

boas19910115 avatar Oct 10 '18 05:10 boas19910115

Maybe Jenkins is needing a finalization command. Something like process.exit()

lean avatar Oct 10 '18 13:10 lean

I'm getting the same error:

ERROR in bundle.js from UglifyJs Unexpected token: name (Game) [bundle.js:3273,6] npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] deploy: webpack --config webpack.production.config.js npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] deploy script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

It seems to be having trouble with "game" in Phaser.

DevMerlin avatar Mar 06 '19 21:03 DevMerlin

Same error, please fix

charliemr99 avatar Jun 18 '21 17:06 charliemr99

My log:

[email protected] dev /Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack webpack

[webpack-cli] Failed to load '/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/webpack.config.js' config [webpack-cli] TypeError: webpack.optimize.CommonsChunkPlugin is not a constructor at Object. (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/webpack.config.js:31:5) at Module._compile (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/v8-compile-cache/v8-compile-cache.js:192:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10) at Module.load (internal/modules/cjs/loader.js:928:32) at Function.Module._load (internal/modules/cjs/loader.js:769:14) at Module.require (internal/modules/cjs/loader.js:952:19) at require (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/v8-compile-cache/v8-compile-cache.js:159:20) at WebpackCLI.tryRequireThenImport (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/lib/webpack-cli.js:32:22) at loadConfig (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/lib/webpack-cli.js:1536:38) at WebpackCLI.resolveConfig (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/lib/webpack-cli.js:1639:44) at WebpackCLI.createCompiler (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/lib/webpack-cli.js:2045:33) at WebpackCLI.buildCommand (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/lib/webpack-cli.js:2173:31) at Command. (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/lib/webpack-cli.js:850:36) at Command.listener [as _actionHandler] (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/node_modules/commander/index.js:922:31) at Command._parseCommand (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/node_modules/commander/index.js:1503:14) at Command._dispatchSubcommand (/Users/CarlosMartinez/UNAL/UN_Pokemon/phaser-es6-webpack/node_modules/webpack-cli/node_modules/commander/index.js:1443:18) npm ERR! code ELIFECYCLE npm ERR! errno 2 npm ERR! [email protected] dev: webpack npm ERR! Exit status 2 npm ERR! npm ERR! Failed at the [email protected] 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! /Users/CarlosMartinez/.npm/_logs/2021-06-18T17_03_59_131Z-debug.log

charliemr99 avatar Jun 18 '21 17:06 charliemr99