简体   繁体   中英

Webpack 13 verbose stack Error: my-project@1.0.0 build: webpack --mode development

I'm attending a bootcamp running Mac and using windows at home. I downloaded a webpack project from github to run on my windows 7 system and it won't build. I found this error in a search and it advised running

npm install webpack-dev-server@2.9.7 --save-dev

, but the error persists. I tried starting over on my Win10 laptop and i get the same error.

I did find guidance that on package.json, I should change this line:

"start": "npm run build & webpack-dev-server --open --mode development",

The change was previously using a semi-colon instead of "&". Still no joy.

I need some help.

here is the error log:

0 info it worked if it ends with ok
1 verbose cli [
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   'build'
1 verbose cli ]
2 info using npm@6.12.0
3 info using node@v12.13.0
4 verbose run-script [ 'prebuild', 'build', 'postbuild' ]
5 info lifecycle my-project@1.0.0~prebuild: my-project@1.0.0
6 info lifecycle my-project@1.0.0~build: my-project@1.0.0
7 verbose lifecycle my-project@1.0.0~build: unsafe-perm in lifecycle true
8 verbose lifecycle my-project@1.0.0~build: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\MP3 Machine\code\doctor-week6-codereview\node_modules\.bin;C:\Users\MP3 Machine\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\MP3 Machine\bin;C:\PROGRAM FILES\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\PROGRAM FILES (X86)\COMMON FILES\MICROSOFT SHARED\WINDOWS LIVE;C:\Windows\SYSTEM32;C:\Windows;C:\Windows\SYSTEM32\WBEM;C:\Windows\SYSTEM32\WINDOWSPOWERSHELL\V1.0;C:\PROGRAM FILES (X86)\MICROSOFT SQL SERVER\80\TOOLS\BINN;C:\PROGRAM FILES (X86)\OPENVPN\BIN;C:\PROGRAM FILES (X86)\WINDOWS LIVE\SHARED;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files (x86)\QuickTime\QTSystem;C:\Program Files\Git\cmd;C:\Program Files\nodejs;C:\Program Files\MySQL\MySQL Shell 8.0\bin;C:\Users\MP3 Machine\AppData\Local\learn_ide_3\bin;C:\Users\MP3 Machine\AppData\Roaming\npm;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl
9 verbose lifecycle my-project@1.0.0~build: CWD: C:\Users\MP3 Machine\code\doctor-week6-codereview
10 silly lifecycle my-project@1.0.0~build: Args: [ '/d /s /c', 'webpack --mode development' ]
11 silly lifecycle my-project@1.0.0~build: Returned: code: 2  signal: null
12 info lifecycle my-project@1.0.0~build: Failed to exec build script
13 verbose stack Error: my-project@1.0.0 build: `webpack --mode development`
13 verbose stack Exit status 2
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:210:5)
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 ChildProcess.emit (events.js:210:5)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
14 verbose pkgid my-project@1.0.0
15 verbose cwd C:\Users\MP3 Machine\code\doctor-week6-codereview
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" "build"
18 verbose node v12.13.0
19 verbose npm  v6.12.0
20 error code ELIFECYCLE
21 error errno 2
22 error my-project@1.0.0 build: `webpack --mode development`
22 error Exit status 2
23 error Failed at the my-project@1.0.0 build script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 2, true ]

Just had the same problem. Make sure your main (index) HTML file,is "in" the src file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM