简体   繁体   English

Webpack 13 详细堆栈错误:my-project@1.0.0 构建:webpack --mode development

[英]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.我正在参加一个运行 Mac 并在家里使用 Windows 的训练营。 I downloaded a webpack project from github to run on my windows 7 system and it won't build.我从 github 下载了一个 webpack 项目以在我的 Windows 7 系统上运行,但它不会构建。 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.我尝试在我的 Win10 笔记本电脑上重新开始,但我遇到了同样的错误。

I did find guidance that on package.json, I should change this line:我确实在 package.json 上找到了指导,我应该更改这一行:

"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确保您的主(索引)HTML 文件在 src 文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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