gpt4 book ai didi

javascript - 当我 "TypeError: callbacks[i] is not a function"时,Angular CLI 给了我 "ng serve"

转载 作者:IT王子 更新时间:2023-10-29 03:06:21 25 4
gpt4 key购买 nike

我实际上只是重新安装了 Angular CLI 以便试用它,但我不知道是什么导致了命令行上的以下错误:

    PC:cobros Fran$ ng serve
** NG Live Development Server is listening on localhost:4200, open your browser on http://localhost:4200/ **
95% emitting/Users/Fran/Documents/Workspace/Repos/cobros/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40
callbacks[i](err, result);
^

TypeError: callbacks[i] is not a function
at Storage.finished (/Users/Fran/Documents/Workspace/Repos/cobros/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:40:15)
at /Users/Fran/Documents/Workspace/Repos/cobros/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:77:9
at /Users/Fran/Documents/Workspace/Repos/cobros/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:153:5)

这是我尝试“ng -v”时返回的信息(以防万一):

Angular CLI: 1.6.8
Node: 8.9.0
OS: darwin x64
Angular: 5.2.4
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

@angular/cli: 1.6.8
@angular-devkit/build-optimizer: 0.0.42
@angular-devkit/core: 0.0.29
@angular-devkit/schematics: 0.0.52
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.9.8
@schematics/angular: 0.1.17
typescript: 2.5.3
webpack: 3.10.0

'enhanced-resolve' 模块到底做了什么?我安装 Angular 错了吗?我按照 https://github.com/angular/angular-cli 中的说明进行操作并确保我满足先决条件。

最佳答案

编辑:问题现已解决,因此无需再使用此解决方法。


已找到解决方案(解决方法)here

添加 "copy-webpack-plugin": "4.3.0" 到你的 package.json

感谢@neshkatrapati

关于javascript - 当我 "TypeError: callbacks[i] is not a function"时,Angular CLI 给了我 "ng serve",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48684276/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com