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

前端 未结 12 1400
旧时难觅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:52

    Edit

    Just execute yarn upgrade.

    There was a release of copy_webpack_plugin fixing the bug (4.4.1), so this should be preferred for resolving this issue. With npm, npm --depth 9999 update should do the trick to update all dependencies recursively.

    Regarding the depth argument for npm update:

    As of npm@2.6.1, the npm update will only inspect top-level packages. Prior versions of npm would also recursively inspect all dependencies. To get the old behavior, use npm --depth 9999 update

    Original answer below:

    Solution

    rm -rf node_modules package-lock.json
    npm i copy-webpack-plugin@4.3.1 -E -O
    npm i
    

    Explanation:

    • We remove node_modules and lockfile
    • We specify copy_webpack_plugin only as a peer dependency (option -O) and with an exact version (option -E)
    • We install node_modules

提交回复
热议问题