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

代码下下来后执行 npm run dev 时产生错误信息 #3

Open
Phoenix500526 opened this issue Nov 12, 2020 · 1 comment
Open

Comments

@Phoenix500526
Copy link

在代码下下来后,进入终端执行 npm run dev时产生了错误信息如下:
$ npm run dev

@fe_korey/resume@1.0.2 dev C:\学习盘D\cv
cross-env NODE_ENV=development webpack-dev-server --hot

Happy[babel]: Version: 5.0.1. Threads: 3
× 「wds」: Error: listen EADDRINUSE: address already in use 0.0.0.0:8080
at Server.setupListenHandle [as _listen2] (net.js:1318:16)
at listenInCluster (net.js:1366:12)
at doListen (net.js:1503:7)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '0.0.0.0',
port: 8080
}
Happy[babel]: All set; signaling webpack to proceed.
Happy[less]: Version: 5.0.1. Threads: 3
Happy[less]: All set; signaling webpack to proceed.
Happy[css]: Version: 5.0.1. Threads: 3
Happy[css]: All set; signaling webpack to proceed.
i Compiling Webpack

webpack v4.44.2

60395c28de16fe5499d3
size name module status
52 B 0 multi (webpack)-dev-server/client?http://0.0.0.0:8080 (webpack)/hot/dev-server.js ./src/index.js built
4.15 kB SockJSClient.js (webpack)-dev-server/client/clients/SockJSClient.js built
4.39 kB 0.0.0.0:8080 (webpack)-dev-server/client?http://0.0.0.0:8080 built
3.6 kB overlay.js (webpack)-dev-server/client/overlay.js built
1.57 kB socket.js (webpack)-dev-server/client/socket.js built
2.98 kB createSocketUrl.js (webpack)-dev-server/client/utils/createSocketUrl.js built
964 B log.js (webpack)-dev-server/client/utils/log.js built
1.63 kB reloadApp.js (webpack)-dev-server/client/utils/reloadApp.js built
402 B sendMessage.js (webpack)-dev-server/client/utils/sendMessage.js built
170 B log$ (webpack)/hot sync nonrecursive ^./log$ built
1.63 kB dev-server.js (webpack)/hot/dev-server.js built
75 B emitter.js (webpack)/hot/emitter.js built
1.3 kB log-apply-result.js (webpack)/hot/log-apply-result.js built
1.37 kB log.js (webpack)/hot/log.js built
1.43 kB index.js ./src/index.js built failed ×

size name asset status
959 kB main bundle.js emitted
4.29 kB ico favicon.ico emitted
7.86 kB html index.html emitted

Δt 3621ms (20 modules hidden)

./src/index.js
261:32 error Module build failed (from ./node_modules/happypack/loader.js): Error:
[BABEL] C:\学习盘D\cv\src\index.js: @babel/preset-env: The 'modules'
option must be one of - 'false' to indicate no module processing - a
specific module type: 'commonjs', 'amd', 'umd', 'systemjs' - 'auto'
(default) which will automatically select 'false' if the current
process is known to support ES module syntax, or "commonjs" otherwise
(While processing:
"C:\学习盘D\cv\node_modules\@babel\preset-env\lib\index.js") at
OptionValidator.invariant
(C:\学习盘D\cv\node_modules@babel\helper-validator-option\lib\validator.js:
at validateModulesOption
(C:\学习盘D\cv\node_modules@babel\preset-env\lib\normalize-options.js:82:5)
at normalizeOptions
(C:\学习盘D\cv\node_modules@babel\preset-env\lib\normalize-options.js:145:14)
at C:\学习盘D\cv\node_modules@babel\preset-env\lib\index.js:239:37 at
C:\学习盘D\cv\node_modules@babel\helper-plugin-utils\lib\index.js:19:12
at C:\学习盘D\cv\node_modules@babel\core\lib\config\full.js:211:14 at
Generator.next () at Function.
(C:\学习盘D\cv\node_modules@babel\core\lib\gensync-utils\async.js:26:3)
at Generator.next ()

× 1 problem (1 error, 0 warnings)
√ Webpack: Compiled with some errors in 2.66s
× 「wdm」:
ERROR in ./src/index.js
Module build failed (from ./node_modules/happypack/loader.js):
Error: [BABEL] C:\学习盘D\cv\src\index.js: @babel/preset-env: The 'modules' option must be one of

  • 'false' to indicate no module processing
  • a specific module type: 'commonjs', 'amd', 'umd', 'systemjs' - 'auto' (default) which will automatically select 'false' if the current
    process is known to support ES module syntax, or "commonjs" otherwise
    (While processing: "C:\学习盘D\cv\node_modules\@babel\preset-env\lib\index.js")
    at OptionValidator.invariant (C:\学习盘D\cv\node_modules@babel\helper-validator-option\lib\validator.js:48:13)
    at validateModulesOption (C:\学习盘D\cv\node_modules@babel\preset-env\lib\normalize-options.js:82:5)
    at normalizeOptions (C:\学习盘D\cv\node_modules@babel\preset-env\lib\normalize-options.js:145:14)
    at C:\学习盘D\cv\node_modules@babel\preset-env\lib\index.js:239:37
    at C:\学习盘D\cv\node_modules@babel\helper-plugin-utils\lib\index.js:19:12
    at C:\学习盘D\cv\node_modules@babel\core\lib\config\full.js:211:14
    at Generator.next ()
    at Function. (C:\学习盘D\cv\node_modules@babel\core\lib\gensync-utils\async.js:26:3)
    at Generator.next ()
    at step (C:\学习盘D\cv\node_modules\gensync\index.js:261:32)
    i 「wdm」: Failed to compile.

按照谷歌的结果,我执行了如下命令:
npm install @babel/core @babel/preset-env
结果依然如此。从编译结果,不知道是否是因为版本的原因。另外,我也把 flqin 的相关主题代码下下来跑了一下,编译能成功,运行也没有问题,所以应该不是端口占用的问题,楼主是否可以解决一下?
我的环境是 win10专业版 + npm-6.14.8

@JoeyBling
Copy link
Owner

@Phoenix500526 感谢反馈,现已修复。拉取最新代码即可

000809b

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

2 participants