Angular CLI gives me “TypeError: callbacks[i] is not a function” when I “ng serve”

前端 未结 12 1337
旧时难觅i
旧时难觅i 2020-12-08 02:26

I literally just made a fresh installation of the Angular CLI in order to try it out and I don\'t have a clue on what\'s causing the following error on the command line:

相关标签:
12条回答
  • 2020-12-08 02:54

    Try this command -> npm install copy-webpack-plugin@4.3.0 resolved my issue

    0 讨论(0)
  • 2020-12-08 02:54

    run this command npm install copy-webpack-plugin@4.3.0

    0 讨论(0)
  • 2020-12-08 02:55

    if npm install copy-webpack-plugin@4.3.1 doesn`t help try add in package.json:

    "optionalDependencies": { "copy-webpack-plugin": "4.3.1" }, "resolutions": { "copy-webpack-plugin": "4.3.1" }

    0 讨论(0)
  • 2020-12-08 02:56

    callbacks[i](err, result); ^

    TypeError: callbacks[i] is not a function

    solution:- npm install copy-webpack-plugin@4.3.0

    0 讨论(0)
  • 2020-12-08 02:57

    Try to uninstall and reinstall Angular CLI :

    Global package:

    npm uninstall -g @angular/cli npm cache clean if npm version is > 5 then usenpm cache verifyto avoid errors (or to avoid using --force) npm install -g @angular/cli@latest

    Local project package:

    rm -rf node_modules dist # use rmdir /S/Q node_modules dist in Windows Command Prompt; use rm -r -fo node_modules,dist in Windows PowerShell npm install --save-dev @angular/cli@latest npm install

    0 讨论(0)
  • 2020-12-08 02:59

    EDIT: The issue is now fixed, so there is no need to use this workaround anymore.


    Solution (workaround) found here

    Add "copy-webpack-plugin": "4.3.0" to your package.json

    Thanks @neshkatrapati

    0 讨论(0)
提交回复
热议问题